From 85ca5229a44d072242c2ac598782b20481298636 Mon Sep 17 00:00:00 2001 From: Diptorup Deb Date: Thu, 25 Feb 2021 22:05:01 -0600 Subject: [PATCH] Small changes to DPCTL enums. - Adds a "ALL" entry to DPCTLSyclBackendType and DPCTLSyclDeviceType. - Changes the value of the "Unknown" entry to 0. --- dpctl-capi/include/dpctl_sycl_enum_types.h | 42 +++++++++++++++------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/dpctl-capi/include/dpctl_sycl_enum_types.h b/dpctl-capi/include/dpctl_sycl_enum_types.h index 8b6b413394..4c1790aaff 100644 --- a/dpctl-capi/include/dpctl_sycl_enum_types.h +++ b/dpctl-capi/include/dpctl_sycl_enum_types.h @@ -38,11 +38,12 @@ DPCTL_C_EXTERN_C_BEGIN enum DPCTLSyclBackendType { // clang-format off - DPCTL_UNKNOWN_BACKEND = 0x0, + DPCTL_CUDA = 1 << 13, + DPCTL_HOST = 1 << 14, + DPCTL_LEVEL_ZERO = 1 << 15, DPCTL_OPENCL = 1 << 16, - DPCTL_HOST = 1 << 15, - DPCTL_LEVEL_ZERO = 1 << 14, - DPCTL_CUDA = 1 << 13 + DPCTL_UNKNOWN_BACKEND = 0, + DPCTL_ALL_BACKENDS = ((1<<10)-1) << 7 // clang-format on }; @@ -52,16 +53,18 @@ enum DPCTLSyclBackendType */ enum DPCTLSyclDeviceType { + // Note: before adding new values here look at DPCTLSyclBackendType enum. + // The values should not overlap. + // clang-format off - DPCTL_CPU = 1 << 0, - DPCTL_GPU = 1 << 1, - DPCTL_ACCELERATOR = 1 << 2, - DPCTL_CUSTOM = 1 << 3, - DPCTL_AUTOMATIC = 1 << 4, - DPCTL_HOST_DEVICE = 1 << 5, - DPCTL_ALL = 1 << 6 - // IMP: before adding new values here look at DPCTLSyclBackendType enum. The - // values should not overlap. + DPCTL_ACCELERATOR = 1 << 1, + DPCTL_AUTOMATIC = 1 << 2, + DPCTL_CPU = 1 << 3, + DPCTL_CUSTOM = 1 << 4, + DPCTL_GPU = 1 << 5, + DPCTL_HOST_DEVICE = 1 << 6, + DPCTL_ALL = (1 << 7) -1 , + DPCTL_UNKNOWN_DEVICE = 0 // clang-format on }; @@ -92,4 +95,17 @@ typedef enum DPCTL_VOID_PTR } DPCTLKernelArgType; +/*! + * @brief Enums to depict the properties that can be passed to a sycl::queue + * constructor. + * + */ +typedef enum +{ + // clang-format off + DPCTL_ENABLE_PROFILING = 1 << 1, + DPCTL_IN_ORDER = 1 << 2 + // clang-format on +} DPCTLQueuePropertyType; + DPCTL_C_EXTERN_C_END