xopto.mcbase.mctypes module

class Matrix2Helper[source]

Bases: object

fromarray(array: numpy.ndarray)[source]
toarray()numpy.ndarray[source]
class Matrix3Helper[source]

Bases: object

fromarray(array: numpy.ndarray)[source]
toarray()numpy.ndarray[source]
class McAccu32[source]

Bases: object

Class that represents a 32-bit detector accumulator type. Tends to quickly overflow, even with a relatively small number of simulated photon packets. This class exposes the following attributes:

  • mc_accu_t - Defines the related OpenCL data type.

  • np_accu - Defines the related numpy data type.

  • mc_accu_k - Defines the factor that converts floating-point photon packet weight to an integer.

  • mc_accu_max - Defines the maximum integer value that can be represented by the detector accumulator type.

mc_accu_k = 8388607
mc_accu_t

alias of xopto.cl.cltypes.cl_uint

mc_cnt_max = 4294967296
np_accu = 'uint32'
class McAccu64[source]

Bases: object

Class that represents a 64-bit detector accumulator type. This class exposes the following attributes:

  • mc_accu_t - Defines the related OpenCL data type.

  • np_accu - Defines the related numpy data type.

  • mc_accu_k - Defines the factor that converts floating-point photon packet weight to an integer.

  • mc_accu_max - Defines the maximum integer value that can be represented by the detector accumulator type.

mc_accu_k = 8388607
mc_accu_max = 18446744073709551616
mc_accu_t

alias of xopto.cl.cltypes.cl_ulong

np_accu = 'uint64'
McCnt

alias of xopto.mcbase.mctypes.McCnt32

class McCnt32[source]

Bases: object

Class that represents a 32-bit photon packet counter type. The maximum number of photon packets that can be processed in a single OpenCL call of the Monte Carlo kernel is limited to 4,294,967,296. This class exposes the following attributes:

  • mc_cnt_t - Defines the related OpenCL data type.

  • np_cnt - Defines the related numpy data type.

  • mc_cnt_max - Defines the maximum integer value that can be represented by the photon packet counter type.

mc_cnt_max = 4294967296
mc_cnt_t

alias of xopto.cl.cltypes.cl_uint

np_cnt = 'uint32'
class McCnt64[source]

Bases: object

Class that represents a 64-bit photon packet counter type. The maximum number of photon packets that can be processed in a single OpenCL call of the Monte Carlo kernel is for all practical purposes virtually unlimited (18,446,744,073,709,551,616). This class exposes the following attributes:

  • mc_cnt_t - Defines the related OpenCL data type.

  • np_cnt - Defines the related numpy data type.

  • mc_cnt_max - Defines the maximum integer value that can be represented by the photon packet counter type.

mc_cnt_max = 18446744073709551616
mc_cnt_t

alias of xopto.cl.cltypes.cl_ulong

np_cnt = 'uint64'
class McDataTypes[source]

Bases: xopto.mcbase.mctypes.McFloat, xopto.mcbase.mctypes.McCnt32, xopto.mcbase.mctypes.McInt32, xopto.mcbase.mctypes.McAccu64, xopto.mcbase.mctypes.McSizeT32, xopto.mcbase.mctypes.McDataTypesBase, xopto.mcbase.mctypes._McDataTypesHelper, xopto.mcbase.mcobject.McObject

Class representing Monte Carlo kernel data types. Use the customize static method to customize the default integer, floating-point, detector accumulator and photon packet counter data types.

This class sets up the default set of kernel data types:

  • size type

    Use McSizeT32 for 32-bit unsigned integer size type.

  • integer type

    Use McInt32 for 32-bit integers.

  • photon packet counter type

    Use McCnt32 for a 32-bit unsigned counter.

  • floating point precision

    Use McSingle for single precision floating-point arithmetics.

  • accumulator integer type

    Use McAccu64 for 64-bit detector accumulators.

class McDataTypesBase[source]

Bases: object

class McDataTypesDouble[source]

Bases: xopto.mcbase.mctypes.McDouble, xopto.mcbase.mctypes.McCnt32, xopto.mcbase.mctypes.McInt32, xopto.mcbase.mctypes.McAccu64, xopto.mcbase.mctypes.McSizeT32, xopto.mcbase.mctypes.McDataTypesBase, xopto.mcbase.mctypes._McDataTypesHelper, xopto.mcbase.mcobject.McObject

Class will set up the following OpenCL data types:

  • size type

    Use McSizeT32 for 32-bit unsigned integer size type.

  • integer type

    Use McInt32 for 32-bit integers.

  • photon packet counter type

    Use McCnt32 for a 32-bit unsigned counter.

  • floating point precision

    Use McDouble for double precision floating-point arithmetics.

  • accumulator integer type

    Use McAccu64 for 64-bit detector accumulators.

classmethod double_precsision()xopto.mcbase.mctypes.McDataTypesDouble[source]

Returns a double-precision floating-point variant of the data type.

classmethod single_precision()xopto.mcbase.mctypes.McDataTypesSingle[source]

Returns a single-precision floating-point variant of the data type.

class McDataTypesDoubleCnt64[source]

Bases: xopto.mcbase.mctypes.McDouble, xopto.mcbase.mctypes.McCnt64, xopto.mcbase.mctypes.McInt32, xopto.mcbase.mctypes.McAccu64, xopto.mcbase.mctypes.McSizeT64, xopto.mcbase.mctypes.McDataTypesBase, xopto.mcbase.mctypes._McDataTypesHelper, xopto.mcbase.mcobject.McObject

Class will set up the following OpenCL data types:

  • size type

    Use McSizeT64 for 64-bit unsigned integer size type.

  • integer type

    Use McInt32 for 32-bit integers.

  • photon packet counter type

    Use McCnt32 for a 32-bit unsigned counter.

  • floating point precision

    Use McDouble for double precision floating-point arithmetics.

  • accumulator integer type

    Use McAccu64 for 64-bit detector accumulators.

classmethod double_precsision()xopto.mcbase.mctypes.McDataTypesDoubleCnt64[source]

Returns a double-precision floating-point variant of the data type.

classmethod single_precision()xopto.mcbase.mctypes.McDataTypesSingleCnt64[source]

Returns a single-precision floating-point variant of the data type.

class McDataTypesSingle[source]

Bases: xopto.mcbase.mctypes.McFloat, xopto.mcbase.mctypes.McCnt32, xopto.mcbase.mctypes.McInt32, xopto.mcbase.mctypes.McAccu64, xopto.mcbase.mctypes.McSizeT32, xopto.mcbase.mctypes.McDataTypesBase, xopto.mcbase.mctypes._McDataTypesHelper, xopto.mcbase.mcobject.McObject

Class will set up the following OpenCL data types:

  • size type

    Use McSizeT32 for 32-bit unsigned integer size type.

  • integer type

    Use McInt32 for 32-bit integers.

  • photon packet counter type

    Use McCnt32 for a 32-bit unsigned counter.

  • floating point precision

    Use McSingle for single precision floating-point arithmetics.

  • accumulator integer type

    Use McAccu64 for 64-bit detector accumulators.

classmethod double_precision()xopto.mcbase.mctypes.McDataTypesDouble[source]

Returns a double-precision floating-point variant of the data type.

classmethod single_precision()xopto.mcbase.mctypes.McDataTypesSingle[source]

Returns a single-precision floating-point variant of the data type.

class McDataTypesSingleCnt64[source]

Bases: xopto.mcbase.mctypes.McFloat, xopto.mcbase.mctypes.McCnt64, xopto.mcbase.mctypes.McInt32, xopto.mcbase.mctypes.McAccu64, xopto.mcbase.mctypes.McSizeT64, xopto.mcbase.mctypes.McDataTypesBase, xopto.mcbase.mctypes._McDataTypesHelper, xopto.mcbase.mcobject.McObject

Class will set up the following OpenCL data types:

  • size type

    Use McSizeT64 for 64-bit unsigned integer size type.

  • integer type

    Use McInt32 for 32-bit integers.

  • photon packet counter type

    Use McCnt64 for a 64-bit unsigned counter.

  • floating point precision

    Use McSingle for single precision floating-point arithmetics.

  • accumulator integer type

    Use McAccu64 for 64-bit detector accumulators.

classmethod double_precision()xopto.mcbase.mctypes.McDataTypesDoubleCnt64[source]

Returns a double-precision floating-point variant of the data type.

classmethod single_precision()xopto.mcbase.mctypes.McDataTypesSingleCnt64[source]

Returns a single-precision floating-point variant of the data type.

class McDouble[source]

Bases: object

Class that represents a double precision floating-point data type/arithmetics. This class implements the following attributes that define the related OpenCL data types:

  • mc_fp_t - Scalar floating-point data type.

  • mc_fp<n>_t - Vectorized floating point data types (<n> must be one of 2, 3, 4, 8, 16).

  • mc_point2f_t - Structure representing a 2D point with mc_fp_t coordinates.

  • mc_point3f_t - Structure representing a 3D point with mc_fp_t coordinates.

  • mc_point4f_t - Structure representing a 4D point with mc_fp_t coordinates.

  • mc_matrix2f_t - Structure representing a 2x2 matrix with mc_fp_t components.

  • mc_matrix3f_t - Structure representing a 3x3 matrix with mc_fp_t components.

Attribute that defined the related numpy data type:

  • np_float - Scalar floating-point data type.

  • np2_float - Vector floating-point data type form mc_fp2_t.

  • np3_float - Vector floating-point data type form mc_fp3_t.

  • np4_float - Vector floating-point data type form mc_fp4_t.

Additional attributes of the class:

  • eps - The difference between 1.0 and the next smallest representable float larger than 1.0.

  • mc_fp_maxint - Maximum unsigned integer value that can be represented by the float type.

eps = 2.220446049250313e-16
static fp_str(value: float)str[source]

Convert a floating-point value to a string without loosing precision.

Parameters

value (float) – A floating-point value to convert to string.

Returns

str_value – A string representation of the input floating-point value.

Return type

str

mc_fp16_t

alias of xopto.cl.cltypes.cl_double16

mc_fp2_t

alias of xopto.cl.cltypes.cl_double2

mc_fp3_t

alias of xopto.cl.cltypes.cl_double3

mc_fp4_t

alias of xopto.cl.cltypes.cl_double4

mc_fp8_t

alias of xopto.cl.cltypes.cl_double8

mc_fp_maxint = 4503599627370495
mc_fp_t

alias of xopto.cl.cltypes.cl_double

class mc_matrix2f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Matrix2Helper

Structure representing a 2x2 matrix using double-precision floating-point.

a_11

Structure/Union member

a_12

Structure/Union member

a_21

Structure/Union member

a_22

Structure/Union member

class mc_matrix3f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Matrix3Helper

Structure representing a 3x3 matrix using double-precision floating-point.

a_11

Structure/Union member

a_12

Structure/Union member

a_13

Structure/Union member

a_21

Structure/Union member

a_22

Structure/Union member

a_23

Structure/Union member

a_31

Structure/Union member

a_32

Structure/Union member

a_33

Structure/Union member

class mc_point2f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector2Helper

Structure representing a 2D point using double-precision floating-point.

x

Structure/Union member

y

Structure/Union member

class mc_point3f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 3D point using single-precision floating-point.

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

class mc_point4f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector4Helper

Structure representing a 4D point using single-precision floating-point.

w

Structure/Union member

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

np_float = 'float64'
np_float2 = dtype([('x', '<f8'), ('y', '<f8')])
np_float3 = dtype([('x', '<f8'), ('y', '<f8'), ('z', '<f8'), ('_', '<f8')])
np_float4 = dtype([('x', '<f8'), ('y', '<f8'), ('z', '<f8'), ('w', '<f8')])
class McFloat[source]

Bases: object

Class that represents a single precision floating-point data type/arithmetics. This class implements the following attributes that define the related OpenCL data types:

  • mc_fp_t - Scalar floating-point data type.

  • mc_fp<n>_t - Vectorized floating point data types (<n> must be one of 2, 3, 4, 8, 16).

  • mc_point2f_t - Structure representing a 2D point with mc_fp_t coordinates.

  • mc_point3f_t - Structure representing a 3D point with mc_fp_t coordinates.

  • mc_point4f_t - Structure representing a 4D point with mc_fp_t coordinates.

  • mc_matrix2f_t - Structure representing a 2x2 matrix with mc_fp_t components.

  • mc_matrix3f_t - Structure representing a 3x3 matrix with mc_fp_t components.

Attribute that defined the related numpy data type:

  • np_float - Scalar floating-point data type form mc_fp_t.

  • np2_float - Vector floating-point data type form mc_fp2_t.

  • np3_float - Vector floating-point data type form mc_fp3_t.

  • np4_float - Vector floating-point data type form mc_fp4_t.

Additional attributes of the class:

  • eps - The difference between 1.0 and the next smallest representable float larger than 1.0.

  • mc_fp_maxint - Maximum unsigned integer value that can be represented by the float type.

eps = 1.1920929e-07
static fp_str(value: float)str[source]

Convert a floating-point value to a string without loosing precision.

Parameters

value (float) – A floating-point value to convert to string.

Returns

str_value – A string representation of the input floating-point value.

Return type

str

mc_fp16_t

alias of xopto.cl.cltypes.cl_float16

mc_fp2_t

alias of xopto.cl.cltypes.cl_float2

mc_fp3_t

alias of xopto.cl.cltypes.cl_float3

mc_fp4_t

alias of xopto.cl.cltypes.cl_float4

mc_fp8_t

alias of xopto.cl.cltypes.cl_float8

mc_fp_maxint = 8388607
mc_fp_t

alias of xopto.cl.cltypes.cl_float

class mc_matrix2f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Matrix2Helper

Structure representing a 2x2 matrix using single-precision floating-point.

a_11

Structure/Union member

a_12

Structure/Union member

a_21

Structure/Union member

a_22

Structure/Union member

class mc_matrix3f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Matrix3Helper

Structure representing a 3x3 matrix using single-precision floating-point.

a_11

Structure/Union member

a_12

Structure/Union member

a_13

Structure/Union member

a_21

Structure/Union member

a_22

Structure/Union member

a_23

Structure/Union member

a_31

Structure/Union member

a_32

Structure/Union member

a_33

Structure/Union member

class mc_point2f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector2Helper

Structure representing a 2D point using single-precision floating-point.

x

Structure/Union member

y

Structure/Union member

class mc_point3f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 3D point using single-precision floating-point.

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

class mc_point4f_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector4Helper

Structure representing a 4D point using single-precision floating-point.

w

Structure/Union member

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

np_float = 'float32'
np_float2 = dtype([('x', '<f4'), ('y', '<f4')])
np_float3 = dtype([('x', '<f4'), ('y', '<f4'), ('z', '<f4'), ('_', '<f4')])
np_float4 = dtype([('x', '<f4'), ('y', '<f4'), ('z', '<f4'), ('w', '<f4')])
McFloat32

alias of xopto.mcbase.mctypes.McFloat

McFloat64

alias of xopto.mcbase.mctypes.McDouble

McInt

alias of xopto.mcbase.mctypes.McInt32

class McInt32[source]

Bases: object

Class that represents a 32-bit default integer type. The OpenCL data types are defined by the following attributes:

  • mc_int_t - For signed integers.

  • mc_int<n>_t - For vectorized signed integers (<n> must be one of 2, 3, 4, 8, 16).

  • mc_uint_t - For unsigned integers.

  • mc_uint<n>_t - For vectorized unsigned integers (<n> must be one of 2, 3, 4, 8, 16).

  • mc_point2_t - For a structure representing a 2D point with mc_int_t coordinates.

  • mc_point3_t - For a structure representing a 3D point with mc_int_t coordinates.

  • mc_point4_t - For a structure representing a 4D point with mc_int_t coordinates.

  • mc_matrix3_t - For a structure representing a 3x3 matrix with mc_int_t components.

The related numpy data types are defined by the following attributes:

  • np_int - For signed integers.

  • np_uint - For unsigned integers.

Additional attributes of the class:

  • mc_uint_max - maximum unsigned integer value that can be represented by the data type.

static int_str(value: int)str[source]

Convert an integer value to a string without loosing precision.

Parameters

value (int) – An integer value to convert to string.

Returns

str_value – A string representation of the input integer value.

Return type

str

mc_int16_t

alias of xopto.cl.cltypes.cl_int16

mc_int2_t

alias of xopto.cl.cltypes.cl_int2

mc_int3_t

alias of xopto.cl.cltypes.cl_int3

mc_int4_t

alias of xopto.cl.cltypes.cl_int4

mc_int8_t

alias of xopto.cl.cltypes.cl_int8

mc_int_max = 2147483647
mc_int_t

alias of xopto.cl.cltypes.cl_int

class mc_matrix3_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Matrix3Helper

Structure representing a 3x3 matrix using 32-bit integers.

a_11

Structure/Union member

a_12

Structure/Union member

a_13

Structure/Union member

a_21

Structure/Union member

a_22

Structure/Union member

a_23

Structure/Union member

a_31

Structure/Union member

a_32

Structure/Union member

a_33

Structure/Union member

class mc_point2_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector2Helper

Structure representing a 2D point using 32-bit integers.

x

Structure/Union member

y

Structure/Union member

class mc_point3_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 3D point using 32-bit integers.

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

class mc_point4_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector4Helper

Structure representing a 4D point using 32-bit integers.

w

Structure/Union member

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

mc_uint16_t

alias of xopto.cl.cltypes.cl_uint16

mc_uint2_t

alias of xopto.cl.cltypes.cl_uint2

mc_uint3_t

alias of xopto.cl.cltypes.cl_uint3

mc_uint4_t

alias of xopto.cl.cltypes.cl_uint4

mc_uint8_t

alias of xopto.cl.cltypes.cl_uint8

mc_uint_max = 4294967296
mc_uint_t

alias of xopto.cl.cltypes.cl_uint

np_int = 'int32'
np_uint = 'uint32'
static uint_str(value: int)str[source]

Convert an unsigned integer value to a string without loosing precision.

Parameters

value (int) – An unsigned integer value to convert to string.

Returns

str_value – A string representation of the input unsigned integer value.

Return type

str

class McInt64[source]

Bases: object

Class that represents a 64-bit default integer type. The OpenCL data types are defined by the following attributes:

  • mc_int_t - For signed integers.

  • mc_int<n>_t - For vectorized signed integers (<n> must be one of 2, 3, 4, 8, 16).

  • mc_uint_t - For unsigned integers.

  • mc_uint<n>_t - For vectorized unsigned integers (<n> must be one of 2, 3, 4, 8, 16).

  • mc_point2_t - For a Structure representing a 2D point with mc_int_t coordinates.

  • mc_point3_t - For a Structure for representing a 3D point with mc_int_t coordinates.

  • mc_point4_t - For a Structure for representing a 4D point with mc_int_t coordinates.

  • mc_matrix3_t - For a Structure representing a 3x3 matrix with mc_int_t elements.

The related numpy data types are defined by the following attributes:

  • mc_int_t - For signed integers.

  • mc_uint_t - For unsigned integers.

Additional attributes of the class:

  • mc_uint_max - maximum unsigned integer value that can be represented by the data type.

static int_str(value: int)str[source]

Convert an integer value to a string without loosing precision.

Parameters

value (int) – A integer value to convert to string.

Returns

str_value – A string representation of the input integer value.

Return type

str

mc_int16_t

alias of xopto.cl.cltypes.cl_long16

mc_int2_t

alias of xopto.cl.cltypes.cl_long2

mc_int3_t

alias of xopto.cl.cltypes.cl_long3

mc_int4_t

alias of xopto.cl.cltypes.cl_long4

mc_int8_t

alias of xopto.cl.cltypes.cl_long8

mc_int_max = 9223372036854775807
mc_int_t

alias of xopto.cl.cltypes.cl_long

class mc_matrix3_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Matrix3Helper

Structure representing a 3x3 matrix using 64-bit integers.

a_11

Structure/Union member

a_12

Structure/Union member

a_13

Structure/Union member

a_21

Structure/Union member

a_22

Structure/Union member

a_23

Structure/Union member

a_31

Structure/Union member

a_32

Structure/Union member

a_33

Structure/Union member

class mc_point2_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector2Helper

Structure representing a 2D point using 64-bit integers.

x

Structure/Union member

y

Structure/Union member

class mc_point3_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 3D point using 64-bit integers.

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

class mc_point4_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector4Helper

Structure representing a 4D point using 64-bit integers.

w

Structure/Union member

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

mc_uint16_t

alias of xopto.cl.cltypes.cl_ulong16

mc_uint2_t

alias of xopto.cl.cltypes.cl_ulong2

mc_uint3_t

alias of xopto.cl.cltypes.cl_ulong3

mc_uint4_t

alias of xopto.cl.cltypes.cl_ulong4

mc_uint8_t

alias of xopto.cl.cltypes.cl_ulong8

mc_uint_max = 18446744073709551616
mc_uint_t

alias of xopto.cl.cltypes.cl_ulong

np_uint = 'uint64'
static uint_str(value: int)str[source]

Convert an unsigned integer value to a string without loosing precision.

Parameters

value (int) – An unsigned integer value to convert to string.

Returns

str_value – A string representation of the input unsigned integer value.

Return type

str

McSingle

alias of xopto.mcbase.mctypes.McFloat

class McSizeT32[source]

Bases: object

Class that represents 32-bit size type. The OpenCL data types are defined by the following attributes:

  • mc_size_t - Size type.

  • mc_size<n>_t for vectorized unsigned integers (<n> must be one of 2, 3, 4, 8, 16)

  • mc_point2s_t structure for a 2D point with mc_size_t coordinates.

  • mc_point3s_t structure for a 3D point with mc_size_t coordinates.

  • mc_point4s_t structure for a 4D point with mc_size_t coordinates.

The related numpy data types are defined by the following attributes:

  • np_size - For mc_size_t.

  • np_size2 - For mc_size2_t.

  • np_size3 - For mc_size3_t.

  • np_size4 - For mc_size4_t.

Additional attributes of the class:

  • mc_maxsize - maximum unsigned integer value that can be represented by the size type.

mc_maxsize = 4294967295
class mc_point2s_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 2D point using mc_size_t.

x

Structure/Union member

y

Structure/Union member

class mc_point3s_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 3D point using mc_size_t.

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

class mc_point4s_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector4Helper

Structure representing a 4D point using mc_size_t.

w

Structure/Union member

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

mc_size16_t

alias of xopto.cl.cltypes.cl_uint16

mc_size2_t

alias of xopto.cl.cltypes.cl_uint2

mc_size3_t

alias of xopto.cl.cltypes.cl_uint3

mc_size4_t

alias of xopto.cl.cltypes.cl_uint4

mc_size8_t

alias of xopto.cl.cltypes.cl_uint8

mc_size_t

alias of xopto.cl.cltypes.cl_uint

np_size = 'uint32'
np_size2 = dtype([('x', '<u4'), ('y', '<u4')])
np_size3 = dtype([('x', '<u4'), ('y', '<u4'), ('z', '<u4'), ('_', '<u4')])
np_size4 = dtype([('x', '<u4'), ('y', '<u4'), ('z', '<u4'), ('w', '<u4')])
static size_t_str(value: int)str[source]

Convert a size type integer value to a string without loosing precision.

Parameters

value (int) – A size type integer value to convert to string.

Returns

str_value – A string representation of the input size type integer value.

Return type

str

class McSizeT64[source]

Bases: object

Class that represents 64-bit size type. The OpenCL data types are defined by the following attributes:

  • mc_size_t - Size type.

  • mc_size<n>_t - For vectorized unsigned integers (<n> must be one of 2, 3, 4, 8, 16)

  • mc_point2s_t structure for a 2D point with mc_size_t coordinates.

  • mc_point3s_t structure for a 3D point with mc_size_t coordinates.

  • mc_point4s_t structure for a 4D point with mc_size_t coordinates.

  • mc_point2_t - For a structure representing a 2D point with mc_int_t coordinates.

  • mc_point3_t - For a structure representing a 3D point with mc_int_t coordinates.

  • mc_point4_t - For a structure representing a 4D point with mc_int_t coordinates.

  • mc_matrix3_t - For a structure representing a 3x3 matrix with mc_int_t components.

The related numpy data types are defined by the following attributes:

  • np_size - For mc_size_t.

  • np_size2 - For mc_size2_t.

  • np_size3 - For mc_size3_t.

  • np_size4 - For mc_size4_t.

Additional attributes of the class:

  • mc_maxsize - maximum unsigned integer value that can be represented by the size type.

mc_maxsize = 18446744073709551615
class mc_point2s_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 2D point using mc_size_t.

x

Structure/Union member

y

Structure/Union member

class mc_point3s_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector3Helper

Structure representing a 3D point using mc_size_t.

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

class mc_point4s_t[source]

Bases: xopto.cl.cltypes.Structure, xopto.mcbase.mctypes.StructToListBasic, xopto.mcbase.mctypes.Vector4Helper

Structure representing a 4D point using mc_size_t.

w

Structure/Union member

x

Structure/Union member

y

Structure/Union member

z

Structure/Union member

mc_size16_t

alias of xopto.cl.cltypes.cl_ulong16

mc_size2_t

alias of xopto.cl.cltypes.cl_ulong2

mc_size3_t

alias of xopto.cl.cltypes.cl_ulong3

mc_size4_t

alias of xopto.cl.cltypes.cl_ulong4

mc_size8_t

alias of xopto.cl.cltypes.cl_ulong8

mc_size_t

alias of xopto.cl.cltypes.cl_ulong

np_size = 'uint64'
np_size2 = dtype([('x', '<u8'), ('y', '<u8')])
np_size3 = dtype([('x', '<u8'), ('y', '<u8'), ('z', '<u8'), ('_', '<u8')])
np_size4 = dtype([('x', '<u8'), ('y', '<u8'), ('z', '<u8'), ('w', '<u8')])
static size_t_str(value: int)str[source]

Convert a size type integer value to a string without loosing precision.

Parameters

value (int) – A size type integer value to convert to string.

Returns

str_value – A string representation of the input size type integer value.

Return type

str

class OpenCLSource(headers: List[str], sources: List[str])[source]

Bases: object

Merges OpenCL header and source files in the listed order.

Parameters
  • headers (list) – List of OpenCL headers.

  • sources (list) – List of OpenCL headers.

render(data: dict)[source]
class StructToListBasic[source]

Bases: object

tolist()[source]
class Vector2Helper[source]

Bases: object

fromarray(array: numpy.ndarray)[source]
toarray()numpy.ndarray[source]
class Vector3Helper[source]

Bases: object

fromarray(array: numpy.ndarray)[source]
toarray()numpy.ndarray[source]
class Vector4Helper[source]

Bases: object

fromarray(array: numpy.ndarray)[source]
toarray()numpy.ndarray[source]