numba_dpex.ocl.atomics.atomic_helper module

numba_dpex.ocl.atomics.atomic_helper.get_memory_semantics_mask(memory_order)

This function translates SYCL memory order to SPIRV memory semantics mask.

For DPCPP implementation please refer: https://github.com/intel/llvm/blob/sycl-nightly/20210507/sycl/include/CL/sycl/detail/spirv.hpp#L220

numba_dpex.ocl.atomics.atomic_helper.get_scope(memory_scope)

This function translates SYCL memory scope to SPIRV scope.

For DPCPP implementation please refer: https://github.com/intel/llvm/blob/sycl-nightly/20210507/sycl/include/CL/sycl/detail/spirv.hpp#L247

class numba_dpex.ocl.atomics.atomic_helper.sycl_memory_order(value)

Bases: enum.Enum

An enumeration of SYCL memory order. For more details please refer to SYCL 2020 specification, section 3.8.3.1 (https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#_memory_ordering).

For DPCPP implementation please refer: https://github.com/intel/llvm/blob/sycl-nightly/20210507/sycl/include/CL/sycl/ONEAPI/atomic_enums.hpp#L25

Memory Order

Enum value

relaxed

0

acquire

1

__consume_unsupported

2

release

3

acq_rel

4

seq_cst

5

acq_rel = 5
acquire = 2
relaxed = 1
release = 4
seq_cst = 6
class numba_dpex.ocl.atomics.atomic_helper.sycl_memory_scope(value)

Bases: enum.Enum

An enumeration of SYCL memory scope. For more details please refer to SYCL 2020 specification, section 3.8.3.2 (https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#_memory_scope).

For DPCPP implementation please refer: https://github.com/intel/llvm/blob/sycl-nightly/20210507/sycl/include/CL/sycl/ONEAPI/atomic_enums.hpp#L45

Memory Scope

Enum value

work_item

0

sub_group

1

work_group

2

device

3

system

4

device = 4
sub_group = 2
system = 5
work_group = 3
work_item = 1