Skip to content

Commit 8a7e228

Browse files
authored
Small changes to DPCTL enums. (#287)
- Adds a "ALL" entry to DPCTLSyclBackendType and DPCTLSyclDeviceType. - Changes the value of the "Unknown" entry to 0.
1 parent bd9fc2b commit 8a7e228

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

dpctl-capi/include/dpctl_sycl_enum_types.h

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ DPCTL_C_EXTERN_C_BEGIN
3838
enum DPCTLSyclBackendType
3939
{
4040
// clang-format off
41-
DPCTL_UNKNOWN_BACKEND = 0x0,
41+
DPCTL_CUDA = 1 << 13,
42+
DPCTL_HOST = 1 << 14,
43+
DPCTL_LEVEL_ZERO = 1 << 15,
4244
DPCTL_OPENCL = 1 << 16,
43-
DPCTL_HOST = 1 << 15,
44-
DPCTL_LEVEL_ZERO = 1 << 14,
45-
DPCTL_CUDA = 1 << 13
45+
DPCTL_UNKNOWN_BACKEND = 0,
46+
DPCTL_ALL_BACKENDS = ((1<<10)-1) << 7
4647
// clang-format on
4748
};
4849

@@ -52,16 +53,18 @@ enum DPCTLSyclBackendType
5253
*/
5354
enum DPCTLSyclDeviceType
5455
{
56+
// Note: before adding new values here look at DPCTLSyclBackendType enum.
57+
// The values should not overlap.
58+
5559
// clang-format off
56-
DPCTL_CPU = 1 << 0,
57-
DPCTL_GPU = 1 << 1,
58-
DPCTL_ACCELERATOR = 1 << 2,
59-
DPCTL_CUSTOM = 1 << 3,
60-
DPCTL_AUTOMATIC = 1 << 4,
61-
DPCTL_HOST_DEVICE = 1 << 5,
62-
DPCTL_ALL = 1 << 6
63-
// IMP: before adding new values here look at DPCTLSyclBackendType enum. The
64-
// values should not overlap.
60+
DPCTL_ACCELERATOR = 1 << 1,
61+
DPCTL_AUTOMATIC = 1 << 2,
62+
DPCTL_CPU = 1 << 3,
63+
DPCTL_CUSTOM = 1 << 4,
64+
DPCTL_GPU = 1 << 5,
65+
DPCTL_HOST_DEVICE = 1 << 6,
66+
DPCTL_ALL = (1 << 7) -1 ,
67+
DPCTL_UNKNOWN_DEVICE = 0
6568
// clang-format on
6669
};
6770

@@ -92,4 +95,17 @@ typedef enum
9295
DPCTL_VOID_PTR
9396
} DPCTLKernelArgType;
9497

98+
/*!
99+
* @brief Enums to depict the properties that can be passed to a sycl::queue
100+
* constructor.
101+
*
102+
*/
103+
typedef enum
104+
{
105+
// clang-format off
106+
DPCTL_ENABLE_PROFILING = 1 << 1,
107+
DPCTL_IN_ORDER = 1 << 2
108+
// clang-format on
109+
} DPCTLQueuePropertyType;
110+
95111
DPCTL_C_EXTERN_C_END

0 commit comments

Comments
 (0)