diff --git a/sycl/include/CL/sycl/accessor.hpp b/sycl/include/CL/sycl/accessor.hpp index e39268fcad55f..fbb728ff85bbc 100644 --- a/sycl/include/CL/sycl/accessor.hpp +++ b/sycl/include/CL/sycl/accessor.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/sycl/include/CL/sycl/aliases.hpp b/sycl/include/CL/sycl/aliases.hpp index 3644c1ec1e393..bb6ccf40cc3d7 100644 --- a/sycl/include/CL/sycl/aliases.hpp +++ b/sycl/include/CL/sycl/aliases.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include #include diff --git a/sycl/include/CL/sycl/atomic.hpp b/sycl/include/CL/sycl/atomic.hpp index d0bad69dbdcab..66075b01c4f3a 100644 --- a/sycl/include/CL/sycl/atomic.hpp +++ b/sycl/include/CL/sycl/atomic.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/sycl/include/CL/sycl/context.hpp b/sycl/include/CL/sycl/context.hpp index 1716f65df6b6e..ad8c266f8e1e9 100644 --- a/sycl/include/CL/sycl/context.hpp +++ b/sycl/include/CL/sycl/context.hpp @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include diff --git a/sycl/include/CL/sycl/detail/common.hpp b/sycl/include/CL/sycl/detail/common.hpp index 603fc11a9cd02..1b0bcd34c95da 100644 --- a/sycl/include/CL/sycl/detail/common.hpp +++ b/sycl/include/CL/sycl/detail/common.hpp @@ -8,10 +8,10 @@ #pragma once -#include #include #include #include +#include #include #include @@ -91,9 +91,9 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { namespace detail { -__SYCL_EXPORT const char *stringifyErrorCode(cl_int error); +__SYCL_EXPORT const char *stringifyErrorCode(pi_int32 error); -static inline std::string codeToString(cl_int code) { +static inline std::string codeToString(pi_int32 code) { return std::string(std::to_string(code) + " (" + stringifyErrorCode(code) + ")"); } @@ -109,20 +109,20 @@ static inline std::string codeToString(cl_int code) { #define __SYCL_ASSERT(x) assert(x) #endif // #ifdef __SYCL_DEVICE_ONLY__ -#define __SYCL_OCL_ERROR_REPORT \ +#define __SYCL_PI_ERROR_REPORT \ "Native API failed. " /*__FILE__*/ \ /* TODO: replace __FILE__ to report only relative path*/ \ /* ":" __SYCL_STRINGIFY(__LINE__) ": " */ \ "Native API returns: " -#ifndef __SYCL_SUPPRESS_OCL_ERROR_REPORT +#ifndef __SYCL_SUPPRESS_PI_ERROR_REPORT #include // TODO: rename all names with direct use of OCL/OPENCL to be backend agnostic. -#define __SYCL_REPORT_OCL_ERR_TO_STREAM(expr) \ +#define __SYCL_REPORT_PI_ERR_TO_STREAM(expr) \ { \ auto code = expr; \ - if (code != CL_SUCCESS) { \ - std::cerr << __SYCL_OCL_ERROR_REPORT \ + if (code != PI_SUCCESS) { \ + std::cerr << __SYCL_PI_ERROR_REPORT \ << cl::sycl::detail::codeToString(code) << std::endl; \ } \ } @@ -131,39 +131,39 @@ static inline std::string codeToString(cl_int code) { #ifndef SYCL_SUPPRESS_EXCEPTIONS #include // SYCL 1.2.1 exceptions -#define __SYCL_REPORT_OCL_ERR_TO_EXC(expr, exc, str) \ +#define __SYCL_REPORT_PI_ERR_TO_EXC(expr, exc, str) \ { \ auto code = expr; \ - if (code != CL_SUCCESS) { \ + if (code != PI_SUCCESS) { \ std::string err_str = \ str ? "\n" + std::string(str) + "\n" : std::string{}; \ - throw exc(__SYCL_OCL_ERROR_REPORT + \ + throw exc(__SYCL_PI_ERROR_REPORT + \ cl::sycl::detail::codeToString(code) + err_str, \ code); \ } \ } -#define __SYCL_REPORT_OCL_ERR_TO_EXC_THROW(code, exc, str) \ - __SYCL_REPORT_OCL_ERR_TO_EXC(code, exc, str) -#define __SYCL_REPORT_OCL_ERR_TO_EXC_BASE(code) \ - __SYCL_REPORT_OCL_ERR_TO_EXC(code, cl::sycl::runtime_error, nullptr) +#define __SYCL_REPORT_PI_ERR_TO_EXC_THROW(code, exc, str) \ + __SYCL_REPORT_PI_ERR_TO_EXC(code, exc, str) +#define __SYCL_REPORT_PI_ERR_TO_EXC_BASE(code) \ + __SYCL_REPORT_PI_ERR_TO_EXC(code, cl::sycl::runtime_error, nullptr) #else -#define __SYCL_REPORT_OCL_ERR_TO_EXC_BASE(code) \ - __SYCL_REPORT_OCL_ERR_TO_STREAM(code) +#define __SYCL_REPORT_PI_ERR_TO_EXC_BASE(code) \ + __SYCL_REPORT_PI_ERR_TO_STREAM(code) #endif // SYCL 2020 exceptions #define __SYCL_REPORT_ERR_TO_EXC_VIA_ERRC(expr, errc) \ { \ auto code = expr; \ - if (code != CL_SUCCESS) { \ + if (code != PI_SUCCESS) { \ throw sycl::exception(sycl::make_error_code(errc), \ - __SYCL_OCL_ERROR_REPORT + \ + __SYCL_PI_ERROR_REPORT + \ cl::sycl::detail::codeToString(code)); \ } \ } #define __SYCL_REPORT_ERR_TO_EXC_THROW_VIA_ERRC(code, errc) \ __SYCL_REPORT_ERR_TO_EXC_VIA_ERRC(code, errc) -#ifdef __SYCL_SUPPRESS_OCL_ERROR_REPORT +#ifdef __SYCL_SUPPRESS_PI_ERROR_REPORT // SYCL 1.2.1 exceptions #define __SYCL_CHECK_OCL_CODE(X) (void)(X) #define __SYCL_CHECK_OCL_CODE_THROW(X, EXC, STR) \ @@ -176,10 +176,10 @@ static inline std::string codeToString(cl_int code) { #define __SYCL_CHECK_CODE_THROW_VIA_ERRC(X, ERRC) (void)(X) #else // SYCL 1.2.1 exceptions -#define __SYCL_CHECK_OCL_CODE(X) __SYCL_REPORT_OCL_ERR_TO_EXC_BASE(X) +#define __SYCL_CHECK_OCL_CODE(X) __SYCL_REPORT_PI_ERR_TO_EXC_BASE(X) #define __SYCL_CHECK_OCL_CODE_THROW(X, EXC, STR) \ - __SYCL_REPORT_OCL_ERR_TO_EXC_THROW(X, EXC, STR) -#define __SYCL_CHECK_OCL_CODE_NO_EXC(X) __SYCL_REPORT_OCL_ERR_TO_STREAM(X) + __SYCL_REPORT_PI_ERR_TO_EXC_THROW(X, EXC, STR) +#define __SYCL_CHECK_OCL_CODE_NO_EXC(X) __SYCL_REPORT_PI_ERR_TO_STREAM(X) // SYCL 2020 exceptions #define __SYCL_CHECK_CODE_THROW_VIA_ERRC(X, ERRC) \ __SYCL_REPORT_ERR_TO_EXC_THROW_VIA_ERRC(X, ERRC) diff --git a/sycl/include/CL/sycl/detail/host_profiling_info.hpp b/sycl/include/CL/sycl/detail/host_profiling_info.hpp index 4aa33f7728b53..d2850113e79d9 100644 --- a/sycl/include/CL/sycl/detail/host_profiling_info.hpp +++ b/sycl/include/CL/sycl/detail/host_profiling_info.hpp @@ -17,18 +17,18 @@ namespace detail { /// Profiling info for the host execution. class __SYCL_EXPORT HostProfilingInfo { - cl_ulong StartTime = 0; - cl_ulong EndTime = 0; + uint64_t StartTime = 0; + uint64_t EndTime = 0; public: /// Returns event's start time. /// /// \return event's start time in nanoseconds. - cl_ulong getStartTime() const { return StartTime; } + uint64_t getStartTime() const { return StartTime; } /// Returns event's end time. /// /// \return event's end time in nanoseconds. - cl_ulong getEndTime() const { return EndTime; } + uint64_t getEndTime() const { return EndTime; } /// Measures event's start time. void start(); diff --git a/sycl/include/CL/sycl/detail/memory_manager.hpp b/sycl/include/CL/sycl/detail/memory_manager.hpp index dfeb1b1365f6a..f77efd7480f9a 100644 --- a/sycl/include/CL/sycl/detail/memory_manager.hpp +++ b/sycl/include/CL/sycl/detail/memory_manager.hpp @@ -9,7 +9,6 @@ #pragma once #include -#include #include #include #include diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 3bd0008cdd457..0778d6796d3e9 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -83,56 +83,12 @@ using pi_native_handle = uintptr_t; // for PI <-> OpenCL ways. The PI <-> to other BE translation is almost // always needed anyway. // -// TODO: populate PI enums. -// typedef enum { - PI_SUCCESS = 0, - PI_ERROR_INVALID_KERNEL_NAME = -46, - PI_ERROR_INVALID_OPERATION = -59, - PI_ERROR_INVALID_KERNEL = -48, - PI_ERROR_INVALID_QUEUE_PROPERTIES = -35, - PI_ERROR_INVALID_VALUE = -30, - PI_ERROR_INVALID_CONTEXT = -34, - PI_ERROR_INVALID_PLATFORM = -32, - PI_ERROR_INVALID_DEVICE = -33, - PI_ERROR_INVALID_BINARY = -42, - PI_ERROR_INVALID_QUEUE = -36, - PI_ERROR_OUT_OF_HOST_MEMORY = -6, - PI_ERROR_INVALID_PROGRAM = -44, - PI_ERROR_INVALID_PROGRAM_EXECUTABLE = -45, - PI_ERROR_INVALID_SAMPLER = -41, - PI_ERROR_INVALID_BUFFER_SIZE = -61, - PI_ERROR_INVALID_MEM_OBJECT = -38, - PI_ERROR_OUT_OF_RESOURCES = -5, - PI_ERROR_INVALID_EVENT = -58, - PI_ERROR_INVALID_EVENT_WAIT_LIST = -57, - PI_ERROR_MISALIGNED_SUB_BUFFER_OFFSET = -13, - PI_ERROR_BUILD_PROGRAM_FAILURE = -11, - PI_ERROR_INVALID_WORK_GROUP_SIZE = -54, - PI_ERROR_COMPILER_NOT_AVAILABLE = -3, - PI_ERROR_PROFILING_INFO_NOT_AVAILABLE = -7, - PI_ERROR_DEVICE_NOT_FOUND = -1, - PI_ERROR_INVALID_WORK_ITEM_SIZE = -55, - PI_ERROR_INVALID_WORK_DIMENSION = -53, - PI_ERROR_INVALID_KERNEL_ARGS = -52, - PI_ERROR_INVALID_IMAGE_SIZE = -40, - PI_ERROR_INVALID_ARG_VALUE = -50, - PI_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR = -39, - PI_ERROR_IMAGE_FORMAT_NOT_SUPPORTED = -10, - PI_ERROR_MEM_OBJECT_ALLOCATION_FAILURE = -4, - PI_ERROR_LINK_PROGRAM_FAILURE = -17, - PI_ERROR_PLUGIN_SPECIFIC_ERROR = - -996, ///< PI_ERROR_PLUGIN_SPECIFIC_ERROR indicates - ///< that an backend spcific error or - ///< warning has been emitted by the plugin. - PI_ERROR_COMMAND_EXECUTION_FAILURE = - -997, ///< PI_ERROR_COMMAND_EXECUTION_FAILURE indicates an error occurred - ///< during command enqueue or execution. - PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE = - -998, ///< PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE indicates a fallback - ///< method determines the function exists but its address cannot be - ///< found. - PI_ERROR_UNKNOWN = -999 +#define _PI_ERRC(NAME, VAL) NAME = VAL, +#define _PI_ERRC_WITH_MSG(NAME, VAL, MSG) NAME = VAL, +#include +#undef _PI_ERRC +#undef _PI_ERRC_WITH_MSG } _pi_result; typedef enum { @@ -180,8 +136,9 @@ typedef enum : pi_uint64 { PI_DEVICE_TYPE_ALL = 0xFFFFFFFF, ///< All devices available in the PI plugin. PI_DEVICE_TYPE_CPU = (1 << 1), ///< A PI device that is the host processor. PI_DEVICE_TYPE_GPU = (1 << 2), ///< A PI device that is a GPU. - PI_DEVICE_TYPE_ACC = (1 << 3) ///< A PI device that is a + PI_DEVICE_TYPE_ACC = (1 << 3), ///< A PI device that is a ///< dedicated accelerator. + PI_DEVICE_TYPE_CUSTOM = (1 << 4) ///< A PI device that is a custom device. } _pi_device_type; typedef enum { @@ -321,6 +278,7 @@ typedef enum { typedef enum { PI_CONTEXT_INFO_DEVICES = 0x1081, + PI_CONTEXT_INFO_PLATFORM = 0x1084, PI_CONTEXT_INFO_NUM_DEVICES = 0x1083, PI_CONTEXT_INFO_PROPERTIES = 0x1082, PI_CONTEXT_INFO_REFERENCE_COUNT = 0x1080, @@ -358,16 +316,6 @@ typedef enum { PI_KERNEL_GROUP_INFO_NUM_REGS = 0x10112 } _pi_kernel_group_info; -typedef enum { - PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT = (1 << 7), - PI_FP_ROUND_TO_NEAREST = (1 << 2), - PI_FP_ROUND_TO_ZERO = (1 << 3), - PI_FP_ROUND_TO_INF = (1 << 4), - PI_FP_INF_NAN = (1 << 1), - PI_FP_DENORM = (1 << 0), - PI_FP_FMA = (1 << 5) -} _pi_fp_capabilities; - typedef enum { PI_IMAGE_INFO_FORMAT = 0x1110, PI_IMAGE_INFO_ELEMENT_SIZE = 0x1111, @@ -608,7 +556,6 @@ using pi_image_info = _pi_image_info; using pi_kernel_info = _pi_kernel_info; using pi_kernel_group_info = _pi_kernel_group_info; using pi_kernel_sub_group_info = _pi_kernel_sub_group_info; -using pi_fp_capabilities = _pi_fp_capabilities; using pi_event_info = _pi_event_info; using pi_command_type = _pi_command_type; using pi_mem_type = _pi_mem_type; @@ -630,6 +577,10 @@ using pi_profiling_info = _pi_profiling_info; using pi_device_partition_property = intptr_t; static constexpr pi_device_partition_property PI_DEVICE_PARTITION_EQUALLY = 0x1086; +static constexpr pi_device_partition_property PI_DEVICE_PARTITION_BY_COUNTS = + 0x1087; +static constexpr pi_device_partition_property + PI_DEVICE_PARTITION_BY_COUNTS_LIST_END = 0x0; static constexpr pi_device_partition_property PI_DEVICE_PARTITION_BY_AFFINITY_DOMAIN = 0x1088; @@ -637,9 +588,34 @@ static constexpr pi_device_partition_property using pi_device_affinity_domain = pi_bitfield; static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_NUMA = (1 << 0); +static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE = + (1 << 1); +static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE = + (1 << 2); +static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE = + (1 << 3); +static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE = + (1 << 4); static constexpr pi_device_affinity_domain PI_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE = (1 << 5); +// For compatibility with OpenCL define this not as enum. +using pi_device_fp_config = pi_bitfield; +static constexpr pi_device_fp_config PI_FP_DENORM = (1 << 0); +static constexpr pi_device_fp_config PI_FP_INF_NAN = (1 << 1); +static constexpr pi_device_fp_config PI_FP_ROUND_TO_NEAREST = (1 << 2); +static constexpr pi_device_fp_config PI_FP_ROUND_TO_ZERO = (1 << 3); +static constexpr pi_device_fp_config PI_FP_ROUND_TO_INF = (1 << 4); +static constexpr pi_device_fp_config PI_FP_FMA = (1 << 5); +static constexpr pi_device_fp_config PI_FP_SOFT_FLOAT = (1 << 6); +static constexpr pi_device_fp_config PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT = + (1 << 7); + +// For compatibility with OpenCL define this not as enum. +using pi_device_exec_capabilities = pi_bitfield; +static constexpr pi_device_exec_capabilities PI_EXEC_KERNEL = (1 << 0); +static constexpr pi_device_exec_capabilities PI_EXEC_NATIVE_KERNEL = (1 << 1); + // Entry type, matches OpenMP for compatibility struct _pi_offload_entry_struct { void *addr; diff --git a/sycl/include/CL/sycl/detail/pi_error.def b/sycl/include/CL/sycl/detail/pi_error.def new file mode 100644 index 0000000000000..99f3d02c18046 --- /dev/null +++ b/sycl/include/CL/sycl/detail/pi_error.def @@ -0,0 +1,111 @@ +_PI_ERRC(PI_SUCCESS, 0) +_PI_ERRC(PI_ERROR_DEVICE_NOT_FOUND, -1) +_PI_ERRC(PI_ERROR_DEVICE_NOT_AVAILABLE, -2) +_PI_ERRC(PI_ERROR_COMPILER_NOT_AVAILABLE, -3) +_PI_ERRC(PI_ERROR_MEM_OBJECT_ALLOCATION_FAILURE, -4) +_PI_ERRC(PI_ERROR_OUT_OF_RESOURCES, -5) +_PI_ERRC(PI_ERROR_OUT_OF_HOST_MEMORY, -6) +_PI_ERRC(PI_ERROR_PROFILING_INFO_NOT_AVAILABLE, -7) +_PI_ERRC(PI_ERROR_MEM_COPY_OVERLAP, -8) +_PI_ERRC(PI_ERROR_IMAGE_FORMAT_MISMATCH, -9) +_PI_ERRC(PI_ERROR_IMAGE_FORMAT_NOT_SUPPORTED, -10) +_PI_ERRC(PI_ERROR_BUILD_PROGRAM_FAILURE, -11) +_PI_ERRC(PI_ERROR_MAP_FAILURE, -12) +_PI_ERRC(PI_ERROR_MISALIGNED_SUB_BUFFER_OFFSET, -13) +_PI_ERRC(PI_ERROR_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST, -14) +_PI_ERRC(PI_ERROR_COMPILE_PROGRAM_FAILURE, -15) +_PI_ERRC(PI_ERROR_LINKER_NOT_AVAILABLE, -16) +_PI_ERRC(PI_ERROR_LINK_PROGRAM_FAILURE, -17) +_PI_ERRC(PI_ERROR_DEVICE_PARTITION_FAILED, -18) +_PI_ERRC(PI_ERROR_KERNEL_ARG_INFO_NOT_AVAILABLE, -19) +_PI_ERRC(PI_ERROR_INVALID_VALUE, -30) +_PI_ERRC(PI_ERROR_INVALID_DEVICE_TYPE, -31) +_PI_ERRC(PI_ERROR_INVALID_PLATFORM, -32) +_PI_ERRC(PI_ERROR_INVALID_DEVICE, -33) +_PI_ERRC(PI_ERROR_INVALID_CONTEXT, -34) +_PI_ERRC(PI_ERROR_INVALID_QUEUE_PROPERTIES, -35) +_PI_ERRC(PI_ERROR_INVALID_QUEUE, -36) +_PI_ERRC(PI_ERROR_INVALID_HOST_PTR, -37) +_PI_ERRC(PI_ERROR_INVALID_MEM_OBJECT, -38) +_PI_ERRC(PI_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR, -39) +_PI_ERRC(PI_ERROR_INVALID_IMAGE_SIZE, -40) +_PI_ERRC(PI_ERROR_INVALID_SAMPLER, -41) +_PI_ERRC(PI_ERROR_INVALID_BINARY, -42) +_PI_ERRC(PI_ERROR_INVALID_BUILD_OPTIONS, -43) +_PI_ERRC(PI_ERROR_INVALID_PROGRAM, -44) +_PI_ERRC(PI_ERROR_INVALID_PROGRAM_EXECUTABLE, -45) +_PI_ERRC(PI_ERROR_INVALID_KERNEL_NAME, -46) +_PI_ERRC(PI_ERROR_INVALID_KERNEL_DEFINITION, -47) +_PI_ERRC(PI_ERROR_INVALID_KERNEL, -48) +_PI_ERRC(PI_ERROR_INVALID_ARG_INDEX, -49) +_PI_ERRC(PI_ERROR_INVALID_ARG_VALUE, -50) +_PI_ERRC(PI_ERROR_INVALID_ARG_SIZE, -51) +_PI_ERRC(PI_ERROR_INVALID_KERNEL_ARGS, -52) +_PI_ERRC(PI_ERROR_INVALID_WORK_DIMENSION, -53) +_PI_ERRC(PI_ERROR_INVALID_WORK_GROUP_SIZE, -54) +_PI_ERRC(PI_ERROR_INVALID_WORK_ITEM_SIZE, -55) +_PI_ERRC(PI_ERROR_INVALID_GLOBAL_OFFSET, -56) +_PI_ERRC(PI_ERROR_INVALID_EVENT_WAIT_LIST, -57) +_PI_ERRC(PI_ERROR_INVALID_EVENT, -58) +_PI_ERRC(PI_ERROR_INVALID_OPERATION, -59) +_PI_ERRC(PI_ERROR_INVALID_GL_OBJECT, -60) +_PI_ERRC(PI_ERROR_INVALID_BUFFER_SIZE, -61) +_PI_ERRC(PI_ERROR_INVALID_MIP_LEVEL, -62) +_PI_ERRC(PI_ERROR_INVALID_GLOBAL_WORK_SIZE, -63) +_PI_ERRC(PI_ERROR_INVALID_PROPERTY, -64) +_PI_ERRC(PI_ERROR_INVALID_IMAGE_DESCRIPTOR, -65) +_PI_ERRC(PI_ERROR_INVALID_COMPILER_OPTIONS, -66) +_PI_ERRC(PI_ERROR_INVALID_LINKER_OPTIONS, -67) +_PI_ERRC(PI_ERROR_INVALID_DEVICE_PARTITION_COUNT, -68) +// cl_gl +_PI_ERRC(PI_ERROR_INVALID_GL_SHAREGROUP_REFERENCE_KHR, -1000) +// KHR Extension +_PI_ERRC(PI_ERROR_PLATFORM_NOT_FOUND_KHR, -1001) +// cl_d3d10 +_PI_ERRC(PI_ERROR_INVALID_D3D10_DEVICE_KHR, -1002) +_PI_ERRC(PI_ERROR_INVALID_D3D10_RESOURCE_KHR, -1003) +_PI_ERRC(PI_ERROR_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR, -1004) +_PI_ERRC(PI_ERROR_D3D10_RESOURCE_NOT_ACQUIRED_KHR, -1005) +// cl_d3d11 +_PI_ERRC(PI_ERROR_INVALID_D3D11_DEVICE_KHR, -1006) +_PI_ERRC(PI_ERROR_INVALID_D3D11_RESOURCE_KHR, -1007) +_PI_ERRC(PI_ERROR_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR, -1008) +_PI_ERRC(PI_ERROR_D3D11_RESOURCE_NOT_ACQUIRED_KHR, -1009) +// cl_dx9_media_sharing +_PI_ERRC(PI_ERROR_INVALID_DX9_DEVICE_INTEL, -1010) +_PI_ERRC(PI_ERROR_INVALID_DX9_RESOURCE_INTEL, -1011) +_PI_ERRC(PI_ERROR_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL, -1012) +_PI_ERRC(PI_ERROR_DX9_RESOURCE_NOT_ACQUIRED_INTEL, -1013) +// cl_ext +_PI_ERRC(PI_ERROR_INVALID_COMMAND_BUFFER_KHR, -1138) +_PI_ERRC(PI_ERROR_INVALID_SYNC_POINT_WAIT_LIST_KHR, -1139) +_PI_ERRC(PI_ERROR_INCOMPATIBLE_COMMAND_QUEUE_KHR, -1140) +// Generic extensions +_PI_ERRC(PI_ERROR_DEVICE_PARTITION_FAILED_EXT, -1057) +_PI_ERRC(PI_ERROR_INVALID_PARTITION_COUNT_EXT, -1058) +_PI_ERRC(PI_ERROR_INVALID_PARTITION_NAME_EXT, -1059) +// cl_egl +_PI_ERRC(PI_ERROR_EGL_RESOURCE_NOT_ACQUIRED_KHR, -1092) +_PI_ERRC(PI_ERROR_INVALID_EGL_OBJECT_KHR, -1093) +// cl_intel_accelerator +_PI_ERRC(PI_ERROR_INVALID_ACCELERATOR_INTEL, -1094) +_PI_ERRC(PI_ERROR_INVALID_ACCELERATOR_TYPE_INTEL, -1095) +_PI_ERRC(PI_ERROR_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, -1096) +_PI_ERRC(PI_ERROR_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL, -1097) +// cl_va_api_media_sharing_intel +_PI_ERRC(PI_ERROR_INVALID_VA_API_MEDIA_ADAPTER_INTEL, -1098) +_PI_ERRC(PI_ERROR_INVALID_VA_API_MEDIA_SURFACE_INTEL, -1099) +_PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL, -1100) +_PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL, -1101) + +// PI specific error codes +// PI_ERROR_PLUGIN_SPECIFIC_ERROR indicates that an backend spcific error or +// warning has been emitted by the plugin. +_PI_ERRC_WITH_MSG(PI_ERROR_PLUGIN_SPECIFIC_ERROR, -996, "Function exists but address is not available") +// PI_ERROR_COMMAND_EXECUTION_FAILURE indicates an error occurred during command +// enqueue or execution. +_PI_ERRC_WITH_MSG(PI_ERROR_COMMAND_EXECUTION_FAILURE, -997, "The plugin has emitted a backend specific error") +// PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE indicates a fallback method +// determines the function exists but its address cannot be found. +_PI_ERRC_WITH_MSG(PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE, -998, "Command failed to enqueue/execute") +_PI_ERRC_WITH_MSG(PI_ERROR_UNKNOWN, -999, "Unknown PI error") diff --git a/sycl/include/CL/sycl/device.hpp b/sycl/include/CL/sycl/device.hpp index 923d1b25bc4e4..1be20d38db45b 100644 --- a/sycl/include/CL/sycl/device.hpp +++ b/sycl/include/CL/sycl/device.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/sycl/include/CL/sycl/event.hpp b/sycl/include/CL/sycl/event.hpp index 98b85f20c4f80..62f4087fd2b1c 100644 --- a/sycl/include/CL/sycl/event.hpp +++ b/sycl/include/CL/sycl/event.hpp @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include diff --git a/sycl/include/CL/sycl/exception.hpp b/sycl/include/CL/sycl/exception.hpp index 58e2de12577a8..1d8157990c0d9 100644 --- a/sycl/include/CL/sycl/exception.hpp +++ b/sycl/include/CL/sycl/exception.hpp @@ -11,6 +11,7 @@ // 4.9.2 Exception Class Interface #include +#include #include #include #include @@ -97,28 +98,28 @@ class __SYCL_EXPORT exception : public std::exception { private: std::string MMsg; - cl_int MCLErr; + pi_int32 MPIErr; std::shared_ptr MContext; protected: // these two constructors are no longer used. Kept for ABI compatability. - exception(const char *Msg, const cl_int CLErr, + exception(const char *Msg, const pi_int32 PIErr, std::shared_ptr Context = nullptr) - : exception(std::string(Msg), CLErr, Context) {} - exception(const std::string &Msg, const cl_int CLErr, + : exception(std::string(Msg), PIErr, Context) {} + exception(const std::string &Msg, const pi_int32 PIErr, std::shared_ptr Context = nullptr) - : MMsg(Msg + " " + detail::codeToString(CLErr)), MCLErr(CLErr), + : MMsg(Msg + " " + detail::codeToString(PIErr)), MPIErr(PIErr), MContext(Context) {} // base constructors used by SYCL 1.2.1 exception subclasses - exception(std::error_code ec, const char *Msg, const cl_int CLErr, + exception(std::error_code ec, const char *Msg, const pi_int32 PIErr, std::shared_ptr Context = nullptr) - : exception(ec, std::string(Msg), CLErr, Context) {} + : exception(ec, std::string(Msg), PIErr, Context) {} - exception(std::error_code ec, const std::string &Msg, const cl_int CLErr, + exception(std::error_code ec, const std::string &Msg, const pi_int32 PIErr, std::shared_ptr Context = nullptr) - : exception(ec, Context, Msg + " " + detail::codeToString(CLErr)) { - MCLErr = CLErr; + : exception(ec, Context, Msg + " " + detail::codeToString(PIErr)) { + MPIErr = PIErr; } exception(const std::string &Msg) : MMsg(Msg), MContext(nullptr) {} @@ -136,14 +137,15 @@ class __SYCL2020_DEPRECATED( public: runtime_error() : exception(make_error_code(errc::runtime)) {} - runtime_error(const char *Msg, cl_int Err) + runtime_error(const char *Msg, pi_int32 Err) : runtime_error(std::string(Msg), Err) {} - runtime_error(const std::string &Msg, cl_int Err) + runtime_error(const std::string &Msg, pi_int32 Err) : exception(make_error_code(errc::runtime), Msg, Err) {} - runtime_error(std::error_code ec, const std::string &Msg, const cl_int CLErr) - : exception(ec, Msg, CLErr) {} + runtime_error(std::error_code ec, const std::string &Msg, + const pi_int32 PIErr) + : exception(ec, Msg, PIErr) {} protected: runtime_error(std::error_code ec) : exception(ec) {} @@ -155,10 +157,10 @@ class __SYCL2020_DEPRECATED("use sycl::exception with sycl::errc::kernel or " public: kernel_error() : runtime_error(make_error_code(errc::kernel)) {} - kernel_error(const char *Msg, cl_int Err) + kernel_error(const char *Msg, pi_int32 Err) : kernel_error(std::string(Msg), Err) {} - kernel_error(const std::string &Msg, cl_int Err) + kernel_error(const std::string &Msg, pi_int32 Err) : runtime_error(make_error_code(errc::kernel), Msg, Err) {} }; @@ -168,10 +170,10 @@ class __SYCL2020_DEPRECATED( public: accessor_error() : runtime_error(make_error_code(errc::accessor)) {} - accessor_error(const char *Msg, cl_int Err) + accessor_error(const char *Msg, pi_int32 Err) : accessor_error(std::string(Msg), Err) {} - accessor_error(const std::string &Msg, cl_int Err) + accessor_error(const std::string &Msg, pi_int32 Err) : runtime_error(make_error_code(errc::accessor), Msg, Err) {} }; @@ -181,10 +183,10 @@ class __SYCL2020_DEPRECATED( public: nd_range_error() : runtime_error(make_error_code(errc::nd_range)) {} - nd_range_error(const char *Msg, cl_int Err) + nd_range_error(const char *Msg, pi_int32 Err) : nd_range_error(std::string(Msg), Err) {} - nd_range_error(const std::string &Msg, cl_int Err) + nd_range_error(const std::string &Msg, pi_int32 Err) : runtime_error(make_error_code(errc::nd_range), Msg, Err) {} }; @@ -194,10 +196,10 @@ class __SYCL2020_DEPRECATED( public: event_error() : runtime_error(make_error_code(errc::event)) {} - event_error(const char *Msg, cl_int Err) + event_error(const char *Msg, pi_int32 Err) : event_error(std::string(Msg), Err) {} - event_error(const std::string &Msg, cl_int Err) + event_error(const std::string &Msg, pi_int32 Err) : runtime_error(make_error_code(errc::event), Msg, Err) {} }; @@ -208,10 +210,10 @@ class __SYCL2020_DEPRECATED( invalid_parameter_error() : runtime_error(make_error_code(errc::kernel_argument)) {} - invalid_parameter_error(const char *Msg, cl_int Err) + invalid_parameter_error(const char *Msg, pi_int32 Err) : invalid_parameter_error(std::string(Msg), Err) {} - invalid_parameter_error(const std::string &Msg, cl_int Err) + invalid_parameter_error(const std::string &Msg, pi_int32 Err) : runtime_error(make_error_code(errc::kernel_argument), Msg, Err) {} }; @@ -221,17 +223,17 @@ class __SYCL2020_DEPRECATED( public: device_error() : exception(make_error_code(errc::invalid)) {} - device_error(const char *Msg, cl_int Err) + device_error(const char *Msg, pi_int32 Err) : device_error(std::string(Msg), Err) {} - device_error(const std::string &Msg, cl_int Err) + device_error(const std::string &Msg, pi_int32 Err) : exception(make_error_code(errc::invalid), Msg, Err) {} protected: device_error(std::error_code ec) : exception(ec) {} - device_error(std::error_code ec, const std::string &Msg, const cl_int CLErr) - : exception(ec, Msg, CLErr) {} + device_error(std::error_code ec, const std::string &Msg, const pi_int32 PIErr) + : exception(ec, Msg, PIErr) {} }; class __SYCL2020_DEPRECATED( @@ -240,10 +242,10 @@ class __SYCL2020_DEPRECATED( public: compile_program_error() : device_error(make_error_code(errc::build)) {} - compile_program_error(const char *Msg, cl_int Err) + compile_program_error(const char *Msg, pi_int32 Err) : compile_program_error(std::string(Msg), Err) {} - compile_program_error(const std::string &Msg, cl_int Err) + compile_program_error(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::build), Msg, Err) {} }; @@ -253,10 +255,10 @@ class __SYCL2020_DEPRECATED( public: link_program_error() : device_error(make_error_code(errc::build)) {} - link_program_error(const char *Msg, cl_int Err) + link_program_error(const char *Msg, pi_int32 Err) : link_program_error(std::string(Msg), Err) {} - link_program_error(const std::string &Msg, cl_int Err) + link_program_error(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::build), Msg, Err) {} }; @@ -266,10 +268,10 @@ class __SYCL2020_DEPRECATED( public: invalid_object_error() : device_error(make_error_code(errc::invalid)) {} - invalid_object_error(const char *Msg, cl_int Err) + invalid_object_error(const char *Msg, pi_int32 Err) : invalid_object_error(std::string(Msg), Err) {} - invalid_object_error(const std::string &Msg, cl_int Err) + invalid_object_error(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::invalid), Msg, Err) {} }; @@ -280,10 +282,10 @@ class __SYCL2020_DEPRECATED( memory_allocation_error() : device_error(make_error_code(errc::memory_allocation)) {} - memory_allocation_error(const char *Msg, cl_int Err) + memory_allocation_error(const char *Msg, pi_int32 Err) : memory_allocation_error(std::string(Msg), Err) {} - memory_allocation_error(const std::string &Msg, cl_int Err) + memory_allocation_error(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::memory_allocation), Msg, Err) {} }; @@ -293,10 +295,10 @@ class __SYCL2020_DEPRECATED( public: platform_error() : device_error(make_error_code(errc::platform)) {} - platform_error(const char *Msg, cl_int Err) + platform_error(const char *Msg, pi_int32 Err) : platform_error(std::string(Msg), Err) {} - platform_error(const std::string &Msg, cl_int Err) + platform_error(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::platform), Msg, Err) {} }; @@ -306,10 +308,10 @@ class __SYCL2020_DEPRECATED( public: profiling_error() : device_error(make_error_code(errc::profiling)) {} - profiling_error(const char *Msg, cl_int Err) + profiling_error(const char *Msg, pi_int32 Err) : profiling_error(std::string(Msg), Err) {} - profiling_error(const std::string &Msg, cl_int Err) + profiling_error(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::profiling), Msg, Err) {} }; @@ -320,10 +322,10 @@ class __SYCL2020_DEPRECATED( feature_not_supported() : device_error(make_error_code(errc::feature_not_supported)) {} - feature_not_supported(const char *Msg, cl_int Err) + feature_not_supported(const char *Msg, pi_int32 Err) : feature_not_supported(std::string(Msg), Err) {} - feature_not_supported(const std::string &Msg, cl_int Err) + feature_not_supported(const std::string &Msg, pi_int32 Err) : device_error(make_error_code(errc::feature_not_supported), Msg, Err) {} }; diff --git a/sycl/include/CL/sycl/handler.hpp b/sycl/include/CL/sycl/handler.hpp index 64a39ee2c40ac..c70bf764f3941 100644 --- a/sycl/include/CL/sycl/handler.hpp +++ b/sycl/include/CL/sycl/handler.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -404,7 +405,7 @@ class __SYCL_EXPORT handler { throw sycl::runtime_error("Attempt to set multiple actions for the " "command group. Command group must consist of " "a single kernel or explicit memory operation.", - CL_INVALID_OPERATION); + PI_ERROR_INVALID_OPERATION); } /// Extracts and prepares kernel arguments from the lambda using integration @@ -2425,7 +2426,7 @@ class __SYCL_EXPORT handler { if (Dst.get_size() < Src.get_size()) throw sycl::invalid_object_error( "The destination accessor size is too small to copy the memory into.", - CL_INVALID_OPERATION); + PI_ERROR_INVALID_OPERATION); if (copyAccToAccHelper(Src, Dst)) return; diff --git a/sycl/include/CL/sycl/info/context_traits.def b/sycl/include/CL/sycl/info/context_traits.def index 13de61c19db03..bd29e14309fb6 100644 --- a/sycl/include/CL/sycl/info/context_traits.def +++ b/sycl/include/CL/sycl/info/context_traits.def @@ -1,4 +1,4 @@ -__SYCL_PARAM_TRAITS_SPEC(context, reference_count, cl_uint) +__SYCL_PARAM_TRAITS_SPEC(context, reference_count, uint32_t) __SYCL_PARAM_TRAITS_SPEC(context, platform, cl::sycl::platform) __SYCL_PARAM_TRAITS_SPEC(context, devices, std::vector) __SYCL_PARAM_TRAITS_SPEC(context, atomic_memory_order_capabilities, std::vector) diff --git a/sycl/include/CL/sycl/info/event_profiling_traits.def b/sycl/include/CL/sycl/info/event_profiling_traits.def index 8419dbca836cf..335888ed808e1 100644 --- a/sycl/include/CL/sycl/info/event_profiling_traits.def +++ b/sycl/include/CL/sycl/info/event_profiling_traits.def @@ -1,4 +1,4 @@ -__SYCL_PARAM_TRAITS_SPEC(event_profiling, command_submit, cl_ulong) -__SYCL_PARAM_TRAITS_SPEC(event_profiling, command_start, cl_ulong) -__SYCL_PARAM_TRAITS_SPEC(event_profiling, command_end, cl_ulong) +__SYCL_PARAM_TRAITS_SPEC(event_profiling, command_submit, uint64_t) +__SYCL_PARAM_TRAITS_SPEC(event_profiling, command_start, uint64_t) +__SYCL_PARAM_TRAITS_SPEC(event_profiling, command_end, uint64_t) diff --git a/sycl/include/CL/sycl/info/event_traits.def b/sycl/include/CL/sycl/info/event_traits.def index 1e42afbf308e1..e77301bcfa9fc 100644 --- a/sycl/include/CL/sycl/info/event_traits.def +++ b/sycl/include/CL/sycl/info/event_traits.def @@ -1,3 +1,3 @@ __SYCL_PARAM_TRAITS_SPEC(event, command_execution_status, info::event_command_status) -__SYCL_PARAM_TRAITS_SPEC(event, reference_count, cl_uint) +__SYCL_PARAM_TRAITS_SPEC(event, reference_count, uint32_t) diff --git a/sycl/include/CL/sycl/info/info_desc.hpp b/sycl/include/CL/sycl/info/info_desc.hpp index 8b0bc8be5a229..b005c936d7da7 100644 --- a/sycl/include/CL/sycl/info/info_desc.hpp +++ b/sycl/include/CL/sycl/info/info_desc.hpp @@ -39,10 +39,10 @@ enum class platform { }; // A.2 Context information desctiptors -enum class context : cl_context_info { - reference_count = CL_CONTEXT_REFERENCE_COUNT, - platform = CL_CONTEXT_PLATFORM, - devices = CL_CONTEXT_DEVICES, +enum class context : pi_uint32 { + reference_count = PI_CONTEXT_INFO_REFERENCE_COUNT, + platform = PI_CONTEXT_INFO_PLATFORM, + devices = PI_CONTEXT_INFO_DEVICES, atomic_memory_order_capabilities = PI_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, atomic_memory_scope_capabilities = @@ -50,95 +50,94 @@ enum class context : cl_context_info { }; // A.3 Device information descriptors -enum class device : cl_device_info { - device_type = CL_DEVICE_TYPE, - vendor_id = CL_DEVICE_VENDOR_ID, - max_compute_units = CL_DEVICE_MAX_COMPUTE_UNITS, - max_work_item_dimensions = CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, - max_work_item_sizes = CL_DEVICE_MAX_WORK_ITEM_SIZES, - max_work_group_size = CL_DEVICE_MAX_WORK_GROUP_SIZE, - - preferred_vector_width_char = CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, - preferred_vector_width_short = CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, - preferred_vector_width_int = CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, - preferred_vector_width_long = CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, - preferred_vector_width_float = CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, - preferred_vector_width_double = CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, - preferred_vector_width_half = CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, - - native_vector_width_char = CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, - native_vector_width_short = CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, - native_vector_width_int = CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, - native_vector_width_long = CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, - native_vector_width_float = CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, - native_vector_width_double = CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, - native_vector_width_half = CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, - - max_clock_frequency = CL_DEVICE_MAX_CLOCK_FREQUENCY, - address_bits = CL_DEVICE_ADDRESS_BITS, - max_mem_alloc_size = CL_DEVICE_MAX_MEM_ALLOC_SIZE, - image_support = CL_DEVICE_IMAGE_SUPPORT, - max_read_image_args = CL_DEVICE_MAX_READ_IMAGE_ARGS, - max_write_image_args = CL_DEVICE_MAX_WRITE_IMAGE_ARGS, - image2d_max_width = CL_DEVICE_IMAGE2D_MAX_WIDTH, - image2d_max_height = CL_DEVICE_IMAGE2D_MAX_HEIGHT, - image3d_max_width = CL_DEVICE_IMAGE3D_MAX_WIDTH, - image3d_max_height = CL_DEVICE_IMAGE3D_MAX_HEIGHT, - image3d_max_depth = CL_DEVICE_IMAGE3D_MAX_DEPTH, - image_max_buffer_size = CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, - image_max_array_size = CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, - max_samplers = CL_DEVICE_MAX_SAMPLERS, - max_parameter_size = CL_DEVICE_MAX_PARAMETER_SIZE, - mem_base_addr_align = CL_DEVICE_MEM_BASE_ADDR_ALIGN, - half_fp_config = CL_DEVICE_HALF_FP_CONFIG, - single_fp_config = CL_DEVICE_SINGLE_FP_CONFIG, - double_fp_config = CL_DEVICE_DOUBLE_FP_CONFIG, - global_mem_cache_type = CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, - global_mem_cache_line_size = CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, - global_mem_cache_size = CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, - global_mem_size = CL_DEVICE_GLOBAL_MEM_SIZE, +enum class device : pi_uint32 { + device_type = PI_DEVICE_INFO_TYPE, + vendor_id = PI_DEVICE_INFO_VENDOR_ID, + max_compute_units = PI_DEVICE_INFO_MAX_COMPUTE_UNITS, + max_work_item_dimensions = PI_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, + max_work_item_sizes = PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, + max_work_group_size = PI_DEVICE_INFO_MAX_WORK_GROUP_SIZE, + + preferred_vector_width_char = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, + preferred_vector_width_short = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, + preferred_vector_width_int = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT, + preferred_vector_width_long = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, + preferred_vector_width_float = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, + preferred_vector_width_double = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, + preferred_vector_width_half = PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, + + native_vector_width_char = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, + native_vector_width_short = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, + native_vector_width_int = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, + native_vector_width_long = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, + native_vector_width_float = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, + native_vector_width_double = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, + native_vector_width_half = PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, + + max_clock_frequency = PI_DEVICE_INFO_MAX_CLOCK_FREQUENCY, + address_bits = PI_DEVICE_INFO_ADDRESS_BITS, + max_mem_alloc_size = PI_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, + image_support = PI_DEVICE_INFO_IMAGE_SUPPORT, + max_read_image_args = PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS, + max_write_image_args = PI_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS, + image2d_max_width = PI_DEVICE_INFO_IMAGE2D_MAX_WIDTH, + image2d_max_height = PI_DEVICE_INFO_IMAGE2D_MAX_HEIGHT, + image3d_max_width = PI_DEVICE_INFO_IMAGE3D_MAX_WIDTH, + image3d_max_height = PI_DEVICE_INFO_IMAGE3D_MAX_HEIGHT, + image3d_max_depth = PI_DEVICE_INFO_IMAGE3D_MAX_DEPTH, + image_max_buffer_size = PI_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE, + image_max_array_size = PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE, + max_samplers = PI_DEVICE_INFO_MAX_SAMPLERS, + max_parameter_size = PI_DEVICE_INFO_MAX_PARAMETER_SIZE, + mem_base_addr_align = PI_DEVICE_INFO_MEM_BASE_ADDR_ALIGN, + half_fp_config = PI_DEVICE_INFO_HALF_FP_CONFIG, + single_fp_config = PI_DEVICE_INFO_SINGLE_FP_CONFIG, + double_fp_config = PI_DEVICE_INFO_DOUBLE_FP_CONFIG, + global_mem_cache_type = PI_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE, + global_mem_cache_line_size = PI_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE, + global_mem_cache_size = PI_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE, + global_mem_size = PI_DEVICE_INFO_GLOBAL_MEM_SIZE, max_constant_buffer_size __SYCL2020_DEPRECATED( "max_constant_buffer_size is deprecated") = - CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, + PI_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE, max_constant_args __SYCL2020_DEPRECATED("max_constant_args is deprecated") = - CL_DEVICE_MAX_CONSTANT_ARGS, - local_mem_type = CL_DEVICE_LOCAL_MEM_TYPE, - local_mem_size = CL_DEVICE_LOCAL_MEM_SIZE, - error_correction_support = CL_DEVICE_ERROR_CORRECTION_SUPPORT, - host_unified_memory = CL_DEVICE_HOST_UNIFIED_MEMORY, - profiling_timer_resolution = CL_DEVICE_PROFILING_TIMER_RESOLUTION, - is_endian_little = CL_DEVICE_ENDIAN_LITTLE, - is_available = CL_DEVICE_AVAILABLE, - is_compiler_available = CL_DEVICE_COMPILER_AVAILABLE, - is_linker_available = CL_DEVICE_LINKER_AVAILABLE, - execution_capabilities = CL_DEVICE_EXECUTION_CAPABILITIES, - queue_profiling = CL_DEVICE_QUEUE_PROPERTIES, + PI_DEVICE_INFO_MAX_CONSTANT_ARGS, + local_mem_type = PI_DEVICE_INFO_LOCAL_MEM_TYPE, + local_mem_size = PI_DEVICE_INFO_LOCAL_MEM_SIZE, + error_correction_support = PI_DEVICE_INFO_ERROR_CORRECTION_SUPPORT, + host_unified_memory = PI_DEVICE_INFO_HOST_UNIFIED_MEMORY, + profiling_timer_resolution = PI_DEVICE_INFO_PROFILING_TIMER_RESOLUTION, + is_endian_little = PI_DEVICE_INFO_ENDIAN_LITTLE, + is_available = PI_DEVICE_INFO_AVAILABLE, + is_compiler_available = PI_DEVICE_INFO_COMPILER_AVAILABLE, + is_linker_available = PI_DEVICE_INFO_LINKER_AVAILABLE, + execution_capabilities = PI_DEVICE_INFO_EXECUTION_CAPABILITIES, + queue_profiling = PI_DEVICE_INFO_QUEUE_PROPERTIES, built_in_kernels __SYCL2020_DEPRECATED("use built_in_kernel_ids instead") = - CL_DEVICE_BUILT_IN_KERNELS, - platform = CL_DEVICE_PLATFORM, - name = CL_DEVICE_NAME, - vendor = CL_DEVICE_VENDOR, - driver_version = CL_DRIVER_VERSION, - profile = CL_DEVICE_PROFILE, - version = CL_DEVICE_VERSION, - opencl_c_version = CL_DEVICE_OPENCL_C_VERSION, + PI_DEVICE_INFO_BUILT_IN_KERNELS, + platform = PI_DEVICE_INFO_PLATFORM, + name = PI_DEVICE_INFO_NAME, + vendor = PI_DEVICE_INFO_VENDOR, + driver_version = PI_DEVICE_INFO_DRIVER_VERSION, + profile = PI_DEVICE_INFO_PROFILE, + version = PI_DEVICE_INFO_VERSION, + opencl_c_version = PI_DEVICE_INFO_OPENCL_C_VERSION, extensions __SYCL2020_DEPRECATED( "device::extensions is deprecated, use info::device::aspects" - " instead.") = CL_DEVICE_EXTENSIONS, - printf_buffer_size = CL_DEVICE_PRINTF_BUFFER_SIZE, - preferred_interop_user_sync = CL_DEVICE_PREFERRED_INTEROP_USER_SYNC, - parent_device = CL_DEVICE_PARENT_DEVICE, - partition_max_sub_devices = CL_DEVICE_PARTITION_MAX_SUB_DEVICES, - partition_properties = CL_DEVICE_PARTITION_PROPERTIES, - partition_affinity_domains = CL_DEVICE_PARTITION_AFFINITY_DOMAIN, - partition_type_affinity_domain = CL_DEVICE_PARTITION_TYPE, - reference_count = CL_DEVICE_REFERENCE_COUNT, - il_version = - CL_DEVICE_IL_VERSION_KHR, // Same as CL_DEVICE_IL_VERSION for >=OpenCL 2.1 - max_num_sub_groups = CL_DEVICE_MAX_NUM_SUB_GROUPS, + " instead.") = PI_DEVICE_INFO_EXTENSIONS, + printf_buffer_size = PI_DEVICE_INFO_PRINTF_BUFFER_SIZE, + preferred_interop_user_sync = PI_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC, + parent_device = PI_DEVICE_INFO_PARENT_DEVICE, + partition_max_sub_devices = PI_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES, + partition_properties = PI_DEVICE_INFO_PARTITION_PROPERTIES, + partition_affinity_domains = PI_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN, + partition_type_affinity_domain = PI_DEVICE_INFO_PARTITION_TYPE, + reference_count = PI_DEVICE_INFO_REFERENCE_COUNT, + il_version = PI_DEVICE_INFO_IL_VERSION, + max_num_sub_groups = PI_DEVICE_INFO_MAX_NUM_SUB_GROUPS, sub_group_independent_forward_progress = - CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, - sub_group_sizes = CL_DEVICE_SUB_GROUP_SIZES_INTEL, + PI_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, + sub_group_sizes = PI_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, partition_type_property, kernel_kernel_pipe_support, built_in_kernel_ids, @@ -179,42 +178,42 @@ enum class device : cl_device_info { }; enum class device_type : pi_uint64 { - cpu = PI_DEVICE_TYPE_CPU, - gpu = PI_DEVICE_TYPE_GPU, + cpu = PI_DEVICE_TYPE_CPU, + gpu = PI_DEVICE_TYPE_GPU, accelerator = PI_DEVICE_TYPE_ACC, // TODO: figure out if we need all the below in PI - custom = CL_DEVICE_TYPE_CUSTOM, + custom = PI_DEVICE_TYPE_CUSTOM, automatic, host, - all = CL_DEVICE_TYPE_ALL + all = PI_DEVICE_TYPE_ALL }; -enum class partition_property : cl_device_partition_property { +enum class partition_property : pi_device_partition_property { no_partition = 0, - partition_equally = CL_DEVICE_PARTITION_EQUALLY, - partition_by_counts = CL_DEVICE_PARTITION_BY_COUNTS, - partition_by_affinity_domain = CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN + partition_equally = PI_DEVICE_PARTITION_EQUALLY, + partition_by_counts = PI_DEVICE_PARTITION_BY_COUNTS, + partition_by_affinity_domain = PI_DEVICE_PARTITION_BY_AFFINITY_DOMAIN }; -enum class partition_affinity_domain : cl_device_affinity_domain { +enum class partition_affinity_domain : pi_device_affinity_domain { not_applicable = 0, - numa = CL_DEVICE_AFFINITY_DOMAIN_NUMA, - L4_cache = CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE, - L3_cache = CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE, - L2_cache = CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE, - L1_cache = CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE, - next_partitionable = CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE + numa = PI_DEVICE_AFFINITY_DOMAIN_NUMA, + L4_cache = PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE, + L3_cache = PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE, + L2_cache = PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE, + L1_cache = PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE, + next_partitionable = PI_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE }; enum class local_mem_type : int { none, local, global }; -enum class fp_config : cl_device_fp_config { - denorm = CL_FP_DENORM, - inf_nan = CL_FP_INF_NAN, - round_to_nearest = CL_FP_ROUND_TO_NEAREST, - round_to_zero = CL_FP_ROUND_TO_ZERO, - round_to_inf = CL_FP_ROUND_TO_INF, - fma = CL_FP_FMA, +enum class fp_config : pi_device_fp_config { + denorm = PI_FP_DENORM, + inf_nan = PI_FP_INF_NAN, + round_to_nearest = PI_FP_ROUND_TO_NEAREST, + round_to_zero = PI_FP_ROUND_TO_ZERO, + round_to_inf = PI_FP_ROUND_TO_INF, + fma = PI_FP_FMA, correctly_rounded_divide_sqrt, soft_float }; @@ -227,84 +226,84 @@ enum class execution_capability : unsigned int { }; // A.4 Queue information descriptors -enum class queue : cl_command_queue_info { - context = CL_QUEUE_CONTEXT, - device = CL_QUEUE_DEVICE, - reference_count = CL_QUEUE_REFERENCE_COUNT +enum class queue : pi_uint32 { + context = PI_QUEUE_INFO_CONTEXT, + device = PI_QUEUE_INFO_DEVICE, + reference_count = PI_QUEUE_INFO_REFERENCE_COUNT }; // A.5 Kernel information desctiptors -enum class kernel : cl_kernel_info { - function_name = CL_KERNEL_FUNCTION_NAME, - num_args = CL_KERNEL_NUM_ARGS, - context = CL_KERNEL_CONTEXT, +enum class kernel : pi_uint32 { + function_name = PI_KERNEL_INFO_FUNCTION_NAME, + num_args = PI_KERNEL_INFO_NUM_ARGS, + context = PI_KERNEL_INFO_CONTEXT, #ifdef __SYCL_INTERNAL_API - program = CL_KERNEL_PROGRAM, + program = PI_KERNEL_INFO_PROGRAM, #endif - reference_count = CL_KERNEL_REFERENCE_COUNT, - attributes = CL_KERNEL_ATTRIBUTES + reference_count = PI_KERNEL_INFO_REFERENCE_COUNT, + attributes = PI_KERNEL_INFO_ATTRIBUTES }; enum class __SYCL2020_DEPRECATED( "kernel_work_group enumeration is deprecated, use SYCL 2020 requests" - " instead") kernel_work_group : cl_kernel_work_group_info { - global_work_size = CL_KERNEL_GLOBAL_WORK_SIZE, - work_group_size = CL_KERNEL_WORK_GROUP_SIZE, - compile_work_group_size = CL_KERNEL_COMPILE_WORK_GROUP_SIZE, + " instead") kernel_work_group : pi_uint32 { + global_work_size = PI_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE, + work_group_size = PI_KERNEL_GROUP_INFO_WORK_GROUP_SIZE, + compile_work_group_size = PI_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE, preferred_work_group_size_multiple = - CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, - private_mem_size = CL_KERNEL_PRIVATE_MEM_SIZE + PI_KERNEL_GROUP_INFO_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, + private_mem_size = PI_KERNEL_GROUP_INFO_PRIVATE_MEM_SIZE }; -enum class kernel_sub_group : cl_kernel_sub_group_info { - max_sub_group_size = CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, - max_num_sub_groups = CL_KERNEL_MAX_NUM_SUB_GROUPS, - compile_num_sub_groups = CL_KERNEL_COMPILE_NUM_SUB_GROUPS, - compile_sub_group_size = CL_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL +enum class kernel_sub_group : pi_uint32 { + max_sub_group_size = PI_KERNEL_MAX_SUB_GROUP_SIZE, + max_num_sub_groups = PI_KERNEL_MAX_NUM_SUB_GROUPS, + compile_num_sub_groups = PI_KERNEL_COMPILE_NUM_SUB_GROUPS, + compile_sub_group_size = PI_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL }; -enum class kernel_device_specific : cl_kernel_work_group_info { - global_work_size = CL_KERNEL_GLOBAL_WORK_SIZE, - work_group_size = CL_KERNEL_WORK_GROUP_SIZE, - compile_work_group_size = CL_KERNEL_COMPILE_WORK_GROUP_SIZE, +enum class kernel_device_specific : pi_uint32 { + global_work_size = PI_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE, + work_group_size = PI_KERNEL_GROUP_INFO_WORK_GROUP_SIZE, + compile_work_group_size = PI_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE, preferred_work_group_size_multiple = - CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, - private_mem_size = CL_KERNEL_PRIVATE_MEM_SIZE, + PI_KERNEL_GROUP_INFO_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, + private_mem_size = PI_KERNEL_GROUP_INFO_PRIVATE_MEM_SIZE, ext_codeplay_num_regs = PI_KERNEL_GROUP_INFO_NUM_REGS, - max_sub_group_size = CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, - max_num_sub_groups = CL_KERNEL_MAX_NUM_SUB_GROUPS, - compile_num_sub_groups = CL_KERNEL_COMPILE_NUM_SUB_GROUPS, - compile_sub_group_size = CL_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL + max_sub_group_size = PI_KERNEL_MAX_SUB_GROUP_SIZE, + max_num_sub_groups = PI_KERNEL_MAX_NUM_SUB_GROUPS, + compile_num_sub_groups = PI_KERNEL_COMPILE_NUM_SUB_GROUPS, + compile_sub_group_size = PI_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL }; // A.6 Program information desctiptors #ifdef __SYCL_INTERNAL_API -enum class program : cl_program_info { - context = CL_PROGRAM_CONTEXT, - devices = CL_PROGRAM_DEVICES, - reference_count = CL_PROGRAM_REFERENCE_COUNT +enum class program : pi_uint32 { + context = PI_PROGRAM_INFO_CONTEXT, + devices = PI_PROGRAM_INFO_DEVICES, + reference_count = PI_PROGRAM_INFO_REFERENCE_COUNT }; #endif // A.7 Event information desctiptors -enum class event : cl_event_info { - reference_count = CL_EVENT_REFERENCE_COUNT, - command_execution_status = CL_EVENT_COMMAND_EXECUTION_STATUS +enum class event : pi_uint32 { + reference_count = PI_EVENT_INFO_REFERENCE_COUNT, + command_execution_status = PI_EVENT_INFO_COMMAND_EXECUTION_STATUS }; -enum class event_command_status : cl_int { - submitted = CL_SUBMITTED, - running = CL_RUNNING, - complete = CL_COMPLETE, +enum class event_command_status : pi_int32 { + submitted = PI_EVENT_SUBMITTED, + running = PI_EVENT_RUNNING, + complete = PI_EVENT_COMPLETE, // Since all BE values are positive, it is safe to use a negative value If you // add other ext_oneapi values ext_oneapi_unknown = -1 }; -enum class event_profiling : cl_profiling_info { - command_submit = CL_PROFILING_COMMAND_SUBMIT, - command_start = CL_PROFILING_COMMAND_START, - command_end = CL_PROFILING_COMMAND_END +enum class event_profiling : pi_uint32 { + command_submit = PI_PROFILING_INFO_COMMAND_SUBMIT, + command_start = PI_PROFILING_INFO_COMMAND_START, + command_end = PI_PROFILING_INFO_COMMAND_END }; // Provide an alias to the return type for each of the info parameters diff --git a/sycl/include/CL/sycl/info/kernel_device_specific_traits.def b/sycl/include/CL/sycl/info/kernel_device_specific_traits.def index 90496dd78d461..367d4fb603cb2 100644 --- a/sycl/include/CL/sycl/info/kernel_device_specific_traits.def +++ b/sycl/include/CL/sycl/info/kernel_device_specific_traits.def @@ -3,7 +3,7 @@ __SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, compile_work_group_size, __SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, global_work_size, cl::sycl::range<3>) __SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, preferred_work_group_size_multiple, size_t) -__SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, private_mem_size, cl_ulong) +__SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, private_mem_size, size_t) __SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, ext_codeplay_num_regs, uint32_t) __SYCL_PARAM_TRAITS_SPEC(kernel_device_specific, work_group_size, size_t) __SYCL_PARAM_TRAITS_SPEC_WITH_INPUT(kernel_device_specific, max_sub_group_size, diff --git a/sycl/include/CL/sycl/info/kernel_traits.def b/sycl/include/CL/sycl/info/kernel_traits.def index 00126cf257390..438b829b76a81 100644 --- a/sycl/include/CL/sycl/info/kernel_traits.def +++ b/sycl/include/CL/sycl/info/kernel_traits.def @@ -1,6 +1,6 @@ __SYCL_PARAM_TRAITS_SPEC(kernel, function_name, std::string) -__SYCL_PARAM_TRAITS_SPEC(kernel, num_args, cl_uint) -__SYCL_PARAM_TRAITS_SPEC(kernel, reference_count, cl_uint) +__SYCL_PARAM_TRAITS_SPEC(kernel, num_args, uint32_t) +__SYCL_PARAM_TRAITS_SPEC(kernel, reference_count, uint32_t) __SYCL_PARAM_TRAITS_SPEC(kernel, attributes, std::string) __SYCL_PARAM_TRAITS_SPEC(kernel, context, cl::sycl::context) #ifdef __SYCL_INTERNAL_API diff --git a/sycl/include/CL/sycl/info/kernel_work_group_traits.def b/sycl/include/CL/sycl/info/kernel_work_group_traits.def index 18edc8c1bc71e..4554c7de92b1f 100644 --- a/sycl/include/CL/sycl/info/kernel_work_group_traits.def +++ b/sycl/include/CL/sycl/info/kernel_work_group_traits.def @@ -2,6 +2,6 @@ __SYCL_PARAM_TRAITS_SPEC(kernel_work_group, compile_work_group_size, cl::sycl::range<3>) __SYCL_PARAM_TRAITS_SPEC(kernel_work_group, global_work_size, cl::sycl::range<3>) __SYCL_PARAM_TRAITS_SPEC(kernel_work_group, preferred_work_group_size_multiple, size_t) -__SYCL_PARAM_TRAITS_SPEC(kernel_work_group, private_mem_size, cl_ulong) +__SYCL_PARAM_TRAITS_SPEC(kernel_work_group, private_mem_size, uint64_t) __SYCL_PARAM_TRAITS_SPEC(kernel_work_group, work_group_size, size_t) diff --git a/sycl/include/CL/sycl/info/program_traits.def b/sycl/include/CL/sycl/info/program_traits.def index 48de0346c1458..de36901e9f404 100644 --- a/sycl/include/CL/sycl/info/program_traits.def +++ b/sycl/include/CL/sycl/info/program_traits.def @@ -1,4 +1,4 @@ __SYCL_PARAM_TRAITS_SPEC(program, context, cl::sycl::context) __SYCL_PARAM_TRAITS_SPEC(program, devices, std::vector) -__SYCL_PARAM_TRAITS_SPEC(program, reference_count, cl_uint) +__SYCL_PARAM_TRAITS_SPEC(program, reference_count, uint32_t) diff --git a/sycl/include/CL/sycl/info/queue_traits.def b/sycl/include/CL/sycl/info/queue_traits.def index cd3b614808dab..d282ebe86dbe0 100644 --- a/sycl/include/CL/sycl/info/queue_traits.def +++ b/sycl/include/CL/sycl/info/queue_traits.def @@ -1,4 +1,4 @@ -__SYCL_PARAM_TRAITS_SPEC(queue, reference_count, cl_uint) +__SYCL_PARAM_TRAITS_SPEC(queue, reference_count, uint32_t) __SYCL_PARAM_TRAITS_SPEC(queue, context, cl::sycl::context) __SYCL_PARAM_TRAITS_SPEC(queue, device, cl::sycl::device) diff --git a/sycl/include/CL/sycl/kernel.hpp b/sycl/include/CL/sycl/kernel.hpp index 178904b1d7a55..4c2baa446df5c 100644 --- a/sycl/include/CL/sycl/kernel.hpp +++ b/sycl/include/CL/sycl/kernel.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include diff --git a/sycl/include/CL/sycl/program.hpp b/sycl/include/CL/sycl/program.hpp index aed136302065a..4657d994d45a2 100644 --- a/sycl/include/CL/sycl/program.hpp +++ b/sycl/include/CL/sycl/program.hpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/sycl/include/CL/sycl/sampler.hpp b/sycl/include/CL/sycl/sampler.hpp index 256fa21be1cac..1d671fc1f189f 100644 --- a/sycl/include/CL/sycl/sampler.hpp +++ b/sycl/include/CL/sycl/sampler.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -17,16 +18,16 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { enum class addressing_mode : unsigned int { - mirrored_repeat = CL_ADDRESS_MIRRORED_REPEAT, - repeat = CL_ADDRESS_REPEAT, - clamp_to_edge = CL_ADDRESS_CLAMP_TO_EDGE, - clamp = CL_ADDRESS_CLAMP, - none = CL_ADDRESS_NONE + mirrored_repeat = PI_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT, + repeat = PI_SAMPLER_ADDRESSING_MODE_REPEAT, + clamp_to_edge = PI_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE, + clamp = PI_SAMPLER_ADDRESSING_MODE_CLAMP, + none = PI_SAMPLER_ADDRESSING_MODE_NONE }; enum class filtering_mode : unsigned int { - nearest = CL_FILTER_NEAREST, - linear = CL_FILTER_LINEAR + nearest = PI_SAMPLER_FILTER_MODE_NEAREST, + linear = PI_SAMPLER_FILTER_MODE_LINEAR }; enum class coordinate_normalization_mode : unsigned int { diff --git a/sycl/source/detail/common.cpp b/sycl/source/detail/common.cpp index 4f4bd54af0608..d28d596d8d2ec 100644 --- a/sycl/source/detail/common.cpp +++ b/sycl/source/detail/common.cpp @@ -13,217 +13,20 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { namespace detail { -const char *stringifyErrorCode(cl_int error) { +const char *stringifyErrorCode(pi_int32 error) { switch (error) { - case CL_INVALID_ACCELERATOR_INTEL: - return "CL_INVALID_ACCELERATOR_INTEL"; - case CL_INVALID_ACCELERATOR_TYPE_INTEL: - return "CL_INVALID_ACCELERATOR_TYPE_INTEL"; - case CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL: - return "CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL"; - case CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL: - return "CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL"; - case CL_PLATFORM_NOT_FOUND_KHR: - return "CL_PLATFORM_NOT_FOUND_KHR"; - case CL_DEVICE_PARTITION_FAILED_EXT: - return "CL_DEVICE_PARTITION_FAILED_EXT"; - case CL_INVALID_PARTITION_COUNT_EXT: - return "CL_INVALID_PARTITION_COUNT_EXT"; - case CL_INVALID_PARTITION_NAME_EXT: - return "CL_INVALID_PARTITION_NAME_EXT"; - /* case CL_INVALID_DX9_DEVICE_INTEL: - return "CL_INVALID_DX9_DEVICE_INTEL"; - case CL_INVALID_DX9_RESOURCE_INTEL: - return "CL_INVALID_DX9_RESOURCE_INTEL"; - case CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL: - return "CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL"; - case CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL: - return "CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL"; - case CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR: - return "CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR"; - */ - case CL_SUCCESS: - return "CL_SUCCESS"; - case CL_DEVICE_NOT_FOUND: - return "CL_DEVICE_NOT_FOUND"; - case CL_DEVICE_NOT_AVAILABLE: - return "CL_DEVICE_NOT_AVAILABLE"; - case CL_COMPILER_NOT_AVAILABLE: - return "CL_COMPILER_NOT_AVAILABLE"; - case CL_MEM_OBJECT_ALLOCATION_FAILURE: - return "CL_MEM_OBJECT_ALLOCATION_FAILURE"; - case CL_OUT_OF_RESOURCES: - return "CL_OUT_OF_RESOURCES"; - case CL_OUT_OF_HOST_MEMORY: - return "CL_OUT_OF_HOST_MEMORY"; - case CL_PROFILING_INFO_NOT_AVAILABLE: - return "CL_PROFILING_INFO_NOT_AVAILABLE"; - case CL_MEM_COPY_OVERLAP: - return "CL_MEM_COPY_OVERLAP"; - case CL_IMAGE_FORMAT_MISMATCH: - return "CL_IMAGE_FORMAT_MISMATCH"; - case CL_IMAGE_FORMAT_NOT_SUPPORTED: - return "CL_IMAGE_FORMAT_NOT_SUPPORTED"; - case CL_BUILD_PROGRAM_FAILURE: - return "CL_BUILD_PROGRAM_FAILURE"; - case CL_MAP_FAILURE: - return "CL_MAP_FAILURE"; - case CL_MISALIGNED_SUB_BUFFER_OFFSET: - return "CL_MISALIGNED_SUB_BUFFER_OFFSET"; - case CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST: - return "CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST"; - case CL_COMPILE_PROGRAM_FAILURE: - return "CL_COMPILE_PROGRAM_FAILURE"; - case CL_LINKER_NOT_AVAILABLE: - return "CL_LINKER_NOT_AVAILABLE"; - case CL_LINK_PROGRAM_FAILURE: - return "CL_LINK_PROGRAM_FAILURE"; - case CL_DEVICE_PARTITION_FAILED: - return "CL_DEVICE_PARTITION_FAILED"; - case CL_KERNEL_ARG_INFO_NOT_AVAILABLE: - return "CL_KERNEL_ARG_INFO_NOT_AVAILABLE"; - case CL_INVALID_VALUE: - return "CL_INVALID_VALUE"; - case CL_INVALID_DEVICE_TYPE: - return "CL_INVALID_DEVICE_TYPE"; - case CL_INVALID_PLATFORM: - return "CL_INVALID_PLATFORM"; - case CL_INVALID_DEVICE: - return "CL_INVALID_DEVICE"; - case CL_INVALID_CONTEXT: - return "CL_INVALID_CONTEXT"; - case CL_INVALID_QUEUE_PROPERTIES: - return "CL_INVALID_QUEUE_PROPERTIES"; - case CL_INVALID_COMMAND_QUEUE: - return "CL_INVALID_COMMAND_QUEUE"; - case CL_INVALID_HOST_PTR: - return "CL_INVALID_HOST_PTR"; - case CL_INVALID_MEM_OBJECT: - return "CL_INVALID_MEM_OBJECT"; - case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR: - return "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR"; - case CL_INVALID_IMAGE_SIZE: - return "CL_INVALID_IMAGE_SIZE"; - case CL_INVALID_SAMPLER: - return "CL_INVALID_SAMPLER"; - case CL_INVALID_BINARY: - return "CL_INVALID_BINARY"; - case CL_INVALID_BUILD_OPTIONS: - return "CL_INVALID_BUILD_OPTIONS"; - case CL_INVALID_PROGRAM: - return "CL_INVALID_PROGRAM"; - case CL_INVALID_PROGRAM_EXECUTABLE: - return "CL_INVALID_PROGRAM_EXECUTABLE"; - case CL_INVALID_KERNEL_NAME: - return "CL_INVALID_KERNEL_NAME"; - case CL_INVALID_KERNEL_DEFINITION: - return "CL_INVALID_KERNEL_DEFINITION"; - case CL_INVALID_KERNEL: - return "CL_INVALID_KERNEL"; - case CL_INVALID_ARG_INDEX: - return "CL_INVALID_ARG_INDEX"; - case CL_INVALID_ARG_VALUE: - return "CL_INVALID_ARG_VALUE"; - case CL_INVALID_ARG_SIZE: - return "CL_INVALID_ARG_SIZE"; - case CL_INVALID_KERNEL_ARGS: - return "CL_INVALID_KERNEL_ARGS"; - case CL_INVALID_WORK_DIMENSION: - return "CL_INVALID_WORK_DIMENSION"; - case CL_INVALID_WORK_GROUP_SIZE: - return "CL_INVALID_WORK_GROUP_SIZE"; - case CL_INVALID_WORK_ITEM_SIZE: - return "CL_INVALID_WORK_ITEM_SIZE"; - case CL_INVALID_GLOBAL_OFFSET: - return "CL_INVALID_GLOBAL_OFFSET"; - case CL_INVALID_EVENT_WAIT_LIST: - return "CL_INVALID_EVENT_WAIT_LIST"; - case CL_INVALID_EVENT: - return "CL_INVALID_EVENT"; - case CL_INVALID_OPERATION: - return "CL_INVALID_OPERATION"; - case CL_INVALID_GL_OBJECT: - return "CL_INVALID_GL_OBJECT"; - case CL_INVALID_BUFFER_SIZE: - return "CL_INVALID_BUFFER_SIZE"; - case CL_INVALID_MIP_LEVEL: - return "CL_INVALID_MIP_LEVEL"; - case CL_INVALID_GLOBAL_WORK_SIZE: - return "CL_INVALID_GLOBAL_WORK_SIZE"; - case CL_INVALID_PROPERTY: - return "CL_INVALID_PROPERTY"; - case CL_INVALID_IMAGE_DESCRIPTOR: - return "CL_INVALID_IMAGE_DESCRIPTOR"; - case CL_INVALID_COMPILER_OPTIONS: - return "CL_INVALID_COMPILER_OPTIONS"; - case CL_INVALID_LINKER_OPTIONS: - return "CL_INVALID_LINKER_OPTIONS"; - case CL_INVALID_DEVICE_PARTITION_COUNT: - return "CL_INVALID_DEVICE_PARTITION_COUNT"; -#ifdef CL_VERSION_2_0 - case CL_INVALID_PIPE_SIZE: - return "CL_INVALID_PIPE_SIZE"; - case CL_INVALID_DEVICE_QUEUE: - return "CL_INVALID_DEVICE_QUEUE"; -#endif -#ifdef CL_VERSION_2_2 - case CL_INVALID_SPEC_ID: - return "CL_INVALID_SPEC_ID"; - case CL_MAX_SIZE_RESTRICTION_EXCEEDED: - return "CL_MAX_SIZE_RESTRICTION_EXCEEDED"; -#endif - /* - case CL_BUILD_NONE: - return "CL_BUILD_NONE"; - case CL_BUILD_ERROR: - return "CL_BUILD_ERROR"; - case CL_BUILD_IN_PROGRESS: - return "CL_BUILD_IN_PROGRESS"; - case CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL: - return "CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL"; - case CL_INVALID_VA_API_MEDIA_SURFACE_INTEL: - return "CL_INVALID_VA_API_MEDIA_SURFACE_INTEL"; - case CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL: - return "CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL"; - case CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL: - return "CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL"; - case CL_INVALID_EGL_OBJECT_KHR: - return "CL_INVALID_EGL_OBJECT_KHR"; - case CL_EGL_RESOURCE_NOT_ACQUIRED_KHR: - return "CL_EGL_RESOURCE_NOT_ACQUIRED_KHR"; - case CL_INVALID_D3D11_DEVICE_KHR: - return "CL_INVALID_D3D11_DEVICE_KHR"; - case CL_INVALID_D3D11_RESOURCE_KHR: - return "CL_INVALID_D3D11_RESOURCE_KHR"; - case CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR: - return "CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR"; - case CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR: - return "CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR"; - case CL_INVALID_D3D10_DEVICE_KHR: - return "CL_INVALID_D3D10_DEVICE_KHR"; - case CL_INVALID_D3D10_RESOURCE_KHR: - return "CL_INVALID_D3D10_RESOURCE_KHR"; - case CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR: - return "CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR"; - case CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR: - return "CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR"; - case CL_INVALID_DX9_MEDIA_ADAPTER_KHR: - return "CL_INVALID_DX9_MEDIA_ADAPTER_KHR"; - case CL_INVALID_DX9_MEDIA_SURFACE_KHR: - return "CL_INVALID_DX9_MEDIA_SURFACE_KHR"; - case CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR: - return "CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR"; - case CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR: - return "CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR"; - */ - case PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE: - return "Function exists but address is not available"; - case PI_ERROR_PLUGIN_SPECIFIC_ERROR: - return "The plugin has emitted a backend specific error"; - case PI_ERROR_COMMAND_EXECUTION_FAILURE: - return "Command failed to enqueue/execute"; +#define _PI_ERRC(NAME, VAL) \ + case NAME: \ + return #NAME; +#define _PI_ERRC_WITH_MSG(NAME, VAL, MSG) \ + case NAME: \ + return MSG; +#include +#undef _PI_ERRC +#undef _PI_ERRC_WITH_MSG + default: - return "Unknown OpenCL error code"; + return "Unknown error code"; } } diff --git a/sycl/source/detail/context_impl.cpp b/sycl/source/detail/context_impl.cpp index 43bb9bc64c438..d8728fb6def18 100644 --- a/sycl/source/detail/context_impl.cpp +++ b/sycl/source/detail/context_impl.cpp @@ -132,7 +132,7 @@ const async_handler &context_impl::get_async_handler() const { } template <> -cl_uint context_impl::get_info() const { +uint32_t context_impl::get_info() const { if (is_host()) return 0; return get_context_info::get( diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index 212e9e5ba2ecc..395f746f5aac5 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -171,8 +171,8 @@ std::vector device_impl::create_sub_devices(size_t ComputeUnits) const { "Total counts exceed max compute units"); size_t SubDevicesCount = MaxComputeUnits / ComputeUnits; - const cl_device_partition_property Properties[3] = { - CL_DEVICE_PARTITION_EQUALLY, (cl_device_partition_property)ComputeUnits, + const pi_device_partition_property Properties[3] = { + PI_DEVICE_PARTITION_EQUALLY, (pi_device_partition_property)ComputeUnits, 0}; return create_sub_devices(Properties, SubDevicesCount); } @@ -189,9 +189,9 @@ device_impl::create_sub_devices(const std::vector &Counts) const { if (!is_partition_supported(info::partition_property::partition_by_counts)) { throw cl::sycl::feature_not_supported(); } - static const cl_device_partition_property P[] = { - CL_DEVICE_PARTITION_BY_COUNTS, CL_DEVICE_PARTITION_BY_COUNTS_LIST_END, 0}; - std::vector Properties(P, P + 3); + static const pi_device_partition_property P[] = { + PI_DEVICE_PARTITION_BY_COUNTS, PI_DEVICE_PARTITION_BY_COUNTS_LIST_END, 0}; + std::vector Properties(P, P + 3); // Fill the properties vector with counts and validate it auto It = Properties.begin() + 1; diff --git a/sycl/source/detail/device_impl.hpp b/sycl/source/detail/device_impl.hpp index 7f0046cd3f0a6..098c82dad8944 100644 --- a/sycl/source/detail/device_impl.hpp +++ b/sycl/source/detail/device_impl.hpp @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include diff --git a/sycl/source/detail/device_info.hpp b/sycl/source/detail/device_info.hpp index f2d57663f9a3b..23b04577863ec 100644 --- a/sycl/source/detail/device_info.hpp +++ b/sycl/source/detail/device_info.hpp @@ -28,51 +28,51 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { namespace detail { -inline std::vector read_fp_bitfield(cl_device_fp_config bits) { +inline std::vector read_fp_bitfield(pi_device_fp_config bits) { std::vector result; - if (bits & CL_FP_DENORM) + if (bits & PI_FP_DENORM) result.push_back(info::fp_config::denorm); - if (bits & CL_FP_INF_NAN) + if (bits & PI_FP_INF_NAN) result.push_back(info::fp_config::inf_nan); - if (bits & CL_FP_ROUND_TO_NEAREST) + if (bits & PI_FP_ROUND_TO_NEAREST) result.push_back(info::fp_config::round_to_nearest); - if (bits & CL_FP_ROUND_TO_ZERO) + if (bits & PI_FP_ROUND_TO_ZERO) result.push_back(info::fp_config::round_to_zero); - if (bits & CL_FP_ROUND_TO_INF) + if (bits & PI_FP_ROUND_TO_INF) result.push_back(info::fp_config::round_to_inf); - if (bits & CL_FP_FMA) + if (bits & PI_FP_FMA) result.push_back(info::fp_config::fma); - if (bits & CL_FP_SOFT_FLOAT) + if (bits & PI_FP_SOFT_FLOAT) result.push_back(info::fp_config::soft_float); - if (bits & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT) + if (bits & PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT) result.push_back(info::fp_config::correctly_rounded_divide_sqrt); return result; } inline std::vector -read_domain_bitfield(cl_device_affinity_domain bits) { +read_domain_bitfield(pi_device_affinity_domain bits) { std::vector result; - if (bits & CL_DEVICE_AFFINITY_DOMAIN_NUMA) + if (bits & PI_DEVICE_AFFINITY_DOMAIN_NUMA) result.push_back(info::partition_affinity_domain::numa); - if (bits & CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE) + if (bits & PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE) result.push_back(info::partition_affinity_domain::L4_cache); - if (bits & CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE) + if (bits & PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE) result.push_back(info::partition_affinity_domain::L3_cache); - if (bits & CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE) + if (bits & PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE) result.push_back(info::partition_affinity_domain::L2_cache); - if (bits & CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE) + if (bits & PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE) result.push_back(info::partition_affinity_domain::L1_cache); - if (bits & CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE) + if (bits & PI_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE) result.push_back(info::partition_affinity_domain::next_partitionable); return result; } inline std::vector -read_execution_bitfield(cl_device_exec_capabilities bits) { +read_execution_bitfield(pi_device_exec_capabilities bits) { std::vector result; - if (bits & CL_EXEC_KERNEL) + if (bits & PI_EXEC_KERNEL) result.push_back(info::execution_capability::exec_kernel); - if (bits & CL_EXEC_NATIVE_KERNEL) + if (bits & PI_EXEC_NATIVE_KERNEL) result.push_back(info::execution_capability::exec_native_kernel); return result; } @@ -215,7 +215,7 @@ struct get_device_info, info::device::single_fp_config> { static std::vector get(RT::PiDevice dev, const plugin &Plugin) { - cl_device_fp_config result; + pi_device_fp_config result; Plugin.call( dev, pi::cast(info::device::single_fp_config), sizeof(result), &result, nullptr); @@ -286,7 +286,7 @@ struct get_device_info, info::device::execution_capabilities> { static std::vector get(RT::PiDevice dev, const plugin &Plugin) { - cl_device_exec_capabilities result; + pi_device_exec_capabilities result; Plugin.call( dev, pi::cast(info::device::execution_capabilities), sizeof(result), &result, nullptr); @@ -388,7 +388,7 @@ struct get_device_info, info::device::partition_affinity_domains> { static std::vector get(RT::PiDevice dev, const plugin &Plugin) { - cl_device_affinity_domain result; + pi_device_affinity_domain result; Plugin.call( dev, pi::cast(info::device::partition_affinity_domains), @@ -419,11 +419,11 @@ struct get_device_info( info::device::partition_type_affinity_domain), sizeof(result), &result, nullptr); - if (result == CL_DEVICE_AFFINITY_DOMAIN_NUMA || - result == CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE || - result == CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE || - result == CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE || - result == CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE) { + if (result == PI_DEVICE_AFFINITY_DOMAIN_NUMA || + result == PI_DEVICE_AFFINITY_DOMAIN_L4_CACHE || + result == PI_DEVICE_AFFINITY_DOMAIN_L3_CACHE || + result == PI_DEVICE_AFFINITY_DOMAIN_L2_CACHE || + result == PI_DEVICE_AFFINITY_DOMAIN_L1_CACHE) { return info::partition_affinity_domain(result); } @@ -596,17 +596,17 @@ inline info::device_type get_device_info_host() { return info::device_type::host; } -template <> inline cl_uint get_device_info_host() { +template <> inline uint32_t get_device_info_host() { return 0x8086; } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return std::thread::hardware_concurrency(); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return 3; } @@ -657,109 +657,111 @@ inline size_t get_device_info_host() { } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 1; } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 1; } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 1; } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 1; } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 1; } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 1; } template <> -inline cl_uint +inline uint32_t get_device_info_host() { // TODO update when appropriate return 0; } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Char); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t +get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Short); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Int); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Long); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t +get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Float); } template <> -inline cl_uint +inline uint32_t get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Double); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex::Half); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return PlatformUtil::getMaxClockFrequency(); } -template <> inline cl_uint get_device_info_host() { +template <> inline uint32_t get_device_info_host() { return sizeof(void *) * 8; } template <> -inline cl_ulong get_device_info_host() { - return static_cast(OSUtil::getOSMemSize()); +inline uint64_t get_device_info_host() { + return static_cast(OSUtil::getOSMemSize()); } template <> -inline cl_ulong get_device_info_host() { +inline uint64_t get_device_info_host() { // current value is the required minimum - const cl_ulong a = get_device_info_host() / 4; - const cl_ulong b = 128ul * 1024 * 1024; + const uint64_t a = get_device_info_host() / 4; + const uint64_t b = 128ul * 1024 * 1024; return (a > b) ? a : b; } @@ -791,13 +793,13 @@ inline bool get_device_info_host() { } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { // current value is the required minimum return 128; } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { // current value is the required minimum return 8; } @@ -894,7 +896,7 @@ inline size_t get_device_info_host() { return 2048; } -template <> inline cl_uint get_device_info_host() { +template <> inline uint32_t get_device_info_host() { // current value is the required minimum return 16; } @@ -906,7 +908,7 @@ inline size_t get_device_info_host() { } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { return 1024; } @@ -940,24 +942,24 @@ get_device_info_host() { } template <> -inline cl_uint +inline uint32_t get_device_info_host() { return PlatformUtil::getMemCacheLineSize(); } template <> -inline cl_ulong get_device_info_host() { +inline uint64_t get_device_info_host() { return PlatformUtil::getMemCacheSize(); } template <> -inline cl_ulong get_device_info_host() { +inline uint64_t get_device_info_host() { // current value is the required minimum return 64 * 1024; } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { // current value is the required minimum return 8; } @@ -969,7 +971,7 @@ get_device_info_host() { } template <> -inline cl_ulong get_device_info_host() { +inline uint64_t get_device_info_host() { // current value is the required minimum return 32 * 1024; } @@ -1093,7 +1095,8 @@ template <> inline device get_device_info_host() { } template <> -inline cl_uint get_device_info_host() { +inline uint32_t +get_device_info_host() { // TODO update once subdevice creation is enabled return 1; } @@ -1126,13 +1129,13 @@ get_device_info_host() { } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { // TODO update once subdevice creation is enabled return 1; } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { // TODO update once subgroups are enabled throw runtime_error("Sub-group feature is not supported on HOST device.", PI_ERROR_INVALID_DEVICE); @@ -1197,7 +1200,7 @@ inline bool get_device_info_host() { return false; } -cl_uint get_native_vector_width(size_t idx); +uint32_t get_native_vector_width(size_t idx); // USM @@ -1284,46 +1287,46 @@ inline std::string get_device_info_host() { PI_ERROR_INVALID_DEVICE); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { throw runtime_error("Obtaining the EU count is not supported on HOST device", PI_ERROR_INVALID_DEVICE); } template <> -inline cl_uint +inline uint32_t get_device_info_host() { throw runtime_error( "Obtaining the EU SIMD width is not supported on HOST device", PI_ERROR_INVALID_DEVICE); } template <> -inline cl_uint get_device_info_host() { +inline uint32_t get_device_info_host() { throw runtime_error( "Obtaining the number of slices is not supported on HOST device", PI_ERROR_INVALID_DEVICE); } template <> -inline cl_uint +inline uint32_t get_device_info_host() { throw runtime_error("Obtaining the number of subslices per slice is not " "supported on HOST device", PI_ERROR_INVALID_DEVICE); } template <> -inline cl_uint +inline uint32_t get_device_info_host() { throw runtime_error( "Obtaining the EU count per subslice is not supported on HOST device", PI_ERROR_INVALID_DEVICE); } template <> -inline cl_uint +inline uint32_t get_device_info_host() { throw runtime_error( "Obtaining the HW threads count per EU is not supported on HOST device", PI_ERROR_INVALID_DEVICE); } template <> -inline cl_ulong +inline uint64_t get_device_info_host() { throw runtime_error( "Obtaining the maximum memory bandwidth is not supported on HOST device", diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp index 09df5c8f4b38c..1d89587963ef0 100644 --- a/sycl/source/detail/event_impl.cpp +++ b/sycl/source/detail/event_impl.cpp @@ -261,7 +261,7 @@ void event_impl::checkProfilingPreconditions() const { } template <> -cl_ulong +uint64_t event_impl::get_profiling_info() const { checkProfilingPreconditions(); if (!MHostEvent) { @@ -278,7 +278,7 @@ event_impl::get_profiling_info() const { } template <> -cl_ulong +uint64_t event_impl::get_profiling_info() const { checkProfilingPreconditions(); if (!MHostEvent) { @@ -295,7 +295,7 @@ event_impl::get_profiling_info() const { } template <> -cl_ulong +uint64_t event_impl::get_profiling_info() const { checkProfilingPreconditions(); if (!MHostEvent) { @@ -310,7 +310,8 @@ event_impl::get_profiling_info() const { return MHostProfilingInfo->getEndTime(); } -template <> cl_uint event_impl::get_info() const { +template <> +uint32_t event_impl::get_info() const { if (!MHostEvent && MEvent) { return get_event_info::get( this->getHandleRef(), this->getPlugin()); diff --git a/sycl/source/detail/event_impl.hpp b/sycl/source/detail/event_impl.hpp index 9841fe5a05079..4f58d5b8bf488 100644 --- a/sycl/source/detail/event_impl.hpp +++ b/sycl/source/detail/event_impl.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include diff --git a/sycl/source/detail/kernel_info.hpp b/sycl/source/detail/kernel_info.hpp index 3d82b850ae98b..129a2e571ab08 100644 --- a/sycl/source/detail/kernel_info.hpp +++ b/sycl/source/detail/kernel_info.hpp @@ -39,13 +39,13 @@ template struct get_kernel_info { } }; -template struct get_kernel_info { - static cl_uint get(RT::PiKernel Kernel, const plugin &Plugin) { - cl_uint Result; +template struct get_kernel_info { + static uint32_t get(RT::PiKernel Kernel, const plugin &Plugin) { + uint32_t Result; // TODO catch an exception and put it to list of asynchronous exceptions Plugin.call(Kernel, pi_kernel_info(Param), - sizeof(cl_uint), &Result, nullptr); + sizeof(uint32_t), &Result, nullptr); return Result; } }; @@ -141,7 +141,7 @@ inline size_t get_kernel_device_specific_info_host< } template <> -inline cl_ulong get_kernel_device_specific_info_host< +inline size_t get_kernel_device_specific_info_host< info::kernel_device_specific::private_mem_size>(const cl::sycl::device &) { return 0; } diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index 134567de154c1..ece95985dd095 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -513,7 +513,7 @@ void copyH2D(SYCLMemObjI *SYCLMemObj, char *SrcMem, QueueImplPtr, if (1 == DimDst && 1 == DimSrc) { Plugin.call( Queue, DstMem, - /*blocking_write=*/CL_FALSE, DstXOffBytes, DstAccessRangeWidthBytes, + /*blocking_write=*/PI_FALSE, DstXOffBytes, DstAccessRangeWidthBytes, SrcMem + SrcXOffBytes, DepEvents.size(), DepEvents.data(), &OutEvent); } else { size_t BufferRowPitch = (1 == DimDst) ? 0 : DstSzWidthBytes; @@ -533,7 +533,7 @@ void copyH2D(SYCLMemObjI *SYCLMemObj, char *SrcMem, QueueImplPtr, Plugin.call( Queue, DstMem, - /*blocking_write=*/CL_FALSE, &BufferOffset, &HostOffset, &RectRegion, + /*blocking_write=*/PI_FALSE, &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, SrcMem, DepEvents.size(), DepEvents.data(), &OutEvent); } @@ -551,7 +551,7 @@ void copyH2D(SYCLMemObjI *SYCLMemObj, char *SrcMem, QueueImplPtr, Plugin.call( Queue, DstMem, - /*blocking_write=*/CL_FALSE, &Origin, &Region, InputRowPitch, + /*blocking_write=*/PI_FALSE, &Origin, &Region, InputRowPitch, InputSlicePitch, SrcMem, DepEvents.size(), DepEvents.data(), &OutEvent); } } @@ -591,7 +591,7 @@ void copyD2H(SYCLMemObjI *SYCLMemObj, RT::PiMem SrcMem, QueueImplPtr SrcQueue, if (1 == DimDst && 1 == DimSrc) { Plugin.call( Queue, SrcMem, - /*blocking_read=*/CL_FALSE, SrcXOffBytes, SrcAccessRangeWidthBytes, + /*blocking_read=*/PI_FALSE, SrcXOffBytes, SrcAccessRangeWidthBytes, DstMem + DstXOffBytes, DepEvents.size(), DepEvents.data(), &OutEvent); } else { size_t BufferRowPitch = (1 == DimSrc) ? 0 : SrcSzWidthBytes; @@ -611,7 +611,7 @@ void copyD2H(SYCLMemObjI *SYCLMemObj, RT::PiMem SrcMem, QueueImplPtr SrcQueue, Plugin.call( Queue, SrcMem, - /*blocking_read=*/CL_FALSE, &BufferOffset, &HostOffset, &RectRegion, + /*blocking_read=*/PI_FALSE, &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, DstMem, DepEvents.size(), DepEvents.data(), &OutEvent); } @@ -628,7 +628,7 @@ void copyD2H(SYCLMemObjI *SYCLMemObj, RT::PiMem SrcMem, QueueImplPtr SrcQueue, SrcAccessRange[SrcPos.ZTerm]}; Plugin.call( - Queue, SrcMem, CL_FALSE, &Offset, &Region, RowPitch, SlicePitch, DstMem, + Queue, SrcMem, PI_FALSE, &Offset, &Region, RowPitch, SlicePitch, DstMem, DepEvents.size(), DepEvents.data(), &OutEvent); } } @@ -839,7 +839,7 @@ void *MemoryManager::map(SYCLMemObjI *, void *Mem, QueueImplPtr Queue, const size_t BytesToMap = AccessRange[0] * AccessRange[1] * AccessRange[2]; const detail::plugin &Plugin = Queue->getPlugin(); memBufferMapHelper(Plugin, Queue->getHandleRef(), pi::cast(Mem), - CL_FALSE, Flags, AccessOffset[0], BytesToMap, + PI_FALSE, Flags, AccessOffset[0], BytesToMap, DepEvents.size(), DepEvents.data(), &OutEvent, &MappedPtr); return MappedPtr; } diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index 248a3b9340b3e..a0e673d440f7d 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include diff --git a/sycl/source/detail/program_impl.cpp b/sycl/source/detail/program_impl.cpp index 66c8b7f152f5e..3ec486c3aa692 100644 --- a/sycl/source/detail/program_impl.cpp +++ b/sycl/source/detail/program_impl.cpp @@ -166,7 +166,7 @@ program_impl::program_impl(ContextImplPtr Context, Plugin.call( MProgram, Device, PI_PROGRAM_BUILD_INFO_BINARY_TYPE, sizeof(cl_program_binary_type), &BinaryType, nullptr); - if (BinaryType == CL_PROGRAM_BINARY_TYPE_NONE) { + if (BinaryType == PI_PROGRAM_BINARY_TYPE_NONE) { throw invalid_object_error( "The native program passed to the program constructor has to be either " "compiled or linked", @@ -181,16 +181,16 @@ program_impl::program_impl(ContextImplPtr Context, OptionsVector.data(), nullptr); std::string Options(OptionsVector.begin(), OptionsVector.end()); switch (BinaryType) { - case CL_PROGRAM_BINARY_TYPE_NONE: + case PI_PROGRAM_BINARY_TYPE_NONE: assert(false); break; - case CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT: + case PI_PROGRAM_BINARY_TYPE_COMPILED_OBJECT: MState = program_state::compiled; MCompileOptions = Options; MBuildOptions = Options; break; - case CL_PROGRAM_BINARY_TYPE_LIBRARY: - case CL_PROGRAM_BINARY_TYPE_EXECUTABLE: + case PI_PROGRAM_BINARY_TYPE_LIBRARY: + case PI_PROGRAM_BINARY_TYPE_EXECUTABLE: MState = program_state::linked; MLinkOptions = ""; MBuildOptions = Options; @@ -505,7 +505,7 @@ void program_impl::create_pi_program_with_kernel_name( } template <> -cl_uint program_impl::get_info() const { +uint32_t program_impl::get_info() const { if (is_host()) { throw invalid_object_error("This instance of program is a host instance", PI_ERROR_INVALID_PROGRAM); diff --git a/sycl/source/detail/program_impl.hpp b/sycl/source/detail/program_impl.hpp index a94924ad73545..bb3d670ef2cfa 100644 --- a/sycl/source/detail/program_impl.hpp +++ b/sycl/source/detail/program_impl.hpp @@ -455,7 +455,7 @@ class program_impl { }; template <> -cl_uint program_impl::get_info() const; +uint32_t program_impl::get_info() const; template <> context program_impl::get_info() const; diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index fd8207041f2fd..a7d82151d59f0 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -913,7 +913,7 @@ ProgramManager::getDeviceImage(OSModuleHandle M, KernelSetId KSId, Ctx->getPlugin().call( getSyclObjImpl(Device)->getHandleRef(), RawImgs.data(), - (cl_uint)RawImgs.size(), &ImgInd); + (pi_uint32)RawImgs.size(), &ImgInd); if (JITCompilationIsRequired) { // If the image is already compiled with AOT, throw an exception. @@ -1466,7 +1466,7 @@ static bool compatibleWithDevice(RTDeviceBinaryImage *BinImage, const_cast(&BinImage->getRawData()); RT::PiResult Error = Plugin.call_nocheck( PIDeviceHandle, &DevBin, - /*num bin images = */ (cl_uint)1, &SuitableImageID); + /*num bin images = */ (pi_uint32)1, &SuitableImageID); if (Error != PI_SUCCESS && Error != PI_ERROR_INVALID_BINARY) throw runtime_error("Invalid binary image or device", PI_ERROR_INVALID_VALUE); diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index 63e4132403ac7..95aa462ba3dee 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -25,7 +25,8 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { namespace detail { -template <> cl_uint queue_impl::get_info() const { +template <> +uint32_t queue_impl::get_info() const { RT::PiResult result = PI_SUCCESS; if (!is_host()) getPlugin().call( diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index 24404c9832e3e..8e713e7fd6c0d 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -749,9 +748,9 @@ bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking, // This will avoid execution of the same failed command twice. MEnqueueStatus = EnqueueResultT::SyclEnqueueFailed; MShouldCompleteEventIfPossible = true; - cl_int Res = enqueueImp(); + pi_int32 Res = enqueueImp(); - if (CL_SUCCESS != Res) + if (PI_SUCCESS != Res) EnqueueResult = EnqueueResultT(EnqueueResultT::SyclEnqueueFailed, this, Res); else { @@ -760,7 +759,7 @@ bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking, MEvent->setComplete(); // Consider the command is successfully enqueued if return code is - // CL_SUCCESS + // PI_SUCCESS MEnqueueStatus = EnqueueResultT::SyclEnqueueSuccess; if (MLeafCounter == 0 && supportsPostEnqueueCleanup() && !SYCLConfig::get()) { @@ -896,7 +895,7 @@ void AllocaCommand::emitInstrumentationData() { #endif } -cl_int AllocaCommand::enqueueImp() { +pi_int32 AllocaCommand::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; @@ -909,7 +908,7 @@ cl_int AllocaCommand::enqueueImp() { // Do not need to make allocation if we have a linked device allocation Command::waitForEvents(MQueue, EventImpls, Event); - return CL_SUCCESS; + return PI_SUCCESS; } HostPtr = MLinkedAllocaCmd->getMemAllocation(); } @@ -919,7 +918,7 @@ cl_int AllocaCommand::enqueueImp() { MQueue->getContextImplPtr(), getSYCLMemObj(), MInitFromUserData, HostPtr, std::move(EventImpls), Event); - return CL_SUCCESS; + return PI_SUCCESS; } void AllocaCommand::printDot(std::ostream &Stream) const { @@ -992,7 +991,7 @@ void *AllocaSubBufCommand::getMemAllocation() const { return MMemAllocation; } -cl_int AllocaSubBufCommand::enqueueImp() { +pi_int32 AllocaSubBufCommand::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; RT::PiEvent &Event = MEvent->getHandleRef(); @@ -1004,7 +1003,7 @@ cl_int AllocaSubBufCommand::enqueueImp() { XPTIRegistry::bufferAssociateNotification(MParentAlloca->getSYCLMemObj(), MMemAllocation); - return CL_SUCCESS; + return PI_SUCCESS; } void AllocaSubBufCommand::printDot(std::ostream &Stream) const { @@ -1057,7 +1056,7 @@ void ReleaseCommand::emitInstrumentationData() { #endif } -cl_int ReleaseCommand::enqueueImp() { +pi_int32 ReleaseCommand::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; std::vector RawEvents = getPiEvents(EventImpls); @@ -1117,7 +1116,7 @@ cl_int ReleaseCommand::enqueueImp() { MQueue->getContextImplPtr(), MAllocaCmd->getSYCLMemObj(), MAllocaCmd->getMemAllocation(), std::move(EventImpls), Event); } - return CL_SUCCESS; + return PI_SUCCESS; } void ReleaseCommand::printDot(std::ostream &Stream) const { @@ -1173,7 +1172,7 @@ void MapMemObject::emitInstrumentationData() { #endif } -cl_int MapMemObject::enqueueImp() { +pi_int32 MapMemObject::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; std::vector RawEvents = getPiEvents(EventImpls); @@ -1185,7 +1184,7 @@ cl_int MapMemObject::enqueueImp() { MMapMode, MSrcReq.MDims, MSrcReq.MMemoryRange, MSrcReq.MAccessRange, MSrcReq.MOffset, MSrcReq.MElemSize, std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } void MapMemObject::printDot(std::ostream &Stream) const { @@ -1254,7 +1253,7 @@ bool UnMapMemObject::producesPiEvent() const { MEvent->getHandleRef() != nullptr; } -cl_int UnMapMemObject::enqueueImp() { +pi_int32 UnMapMemObject::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; std::vector RawEvents = getPiEvents(EventImpls); @@ -1265,7 +1264,7 @@ cl_int UnMapMemObject::enqueueImp() { MDstAllocaCmd->getMemAllocation(), MQueue, *MSrcPtr, std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } void UnMapMemObject::printDot(std::ostream &Stream) const { @@ -1359,7 +1358,7 @@ bool MemCpyCommand::producesPiEvent() const { MEvent->getHandleRef() != nullptr; } -cl_int MemCpyCommand::enqueueImp() { +pi_int32 MemCpyCommand::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; @@ -1375,7 +1374,7 @@ cl_int MemCpyCommand::enqueueImp() { MQueue, MDstReq.MDims, MDstReq.MMemoryRange, MDstReq.MAccessRange, MDstReq.MOffset, MDstReq.MElemSize, std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } void MemCpyCommand::printDot(std::ostream &Stream) const { @@ -1431,7 +1430,7 @@ void ExecCGCommand::clearAuxiliaryResources() { ((CGExecKernel *)MCommandGroup.get())->clearAuxiliaryResources(); } -cl_int UpdateHostRequirementCommand::enqueueImp() { +pi_int32 UpdateHostRequirementCommand::enqueueImp() { waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; RT::PiEvent &Event = MEvent->getHandleRef(); @@ -1442,7 +1441,7 @@ cl_int UpdateHostRequirementCommand::enqueueImp() { assert(MDstPtr && "Expected valid target pointer"); *MDstPtr = MSrcAllocaCmd->getMemAllocation(); - return CL_SUCCESS; + return PI_SUCCESS; } void UpdateHostRequirementCommand::printDot(std::ostream &Stream) const { @@ -1520,7 +1519,7 @@ const QueueImplPtr &MemCpyCommandHost::getWorkerQueue() const { return MQueue->is_host() ? MSrcQueue : MQueue; } -cl_int MemCpyCommandHost::enqueueImp() { +pi_int32 MemCpyCommandHost::enqueueImp() { const QueueImplPtr &Queue = getWorkerQueue(); waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; @@ -1534,7 +1533,7 @@ cl_int MemCpyCommandHost::enqueueImp() { MDstReq.MAccessMode == access::mode::discard_write) { Command::waitForEvents(Queue, EventImpls, Event); - return CL_SUCCESS; + return PI_SUCCESS; } flushCrossQueueDeps(EventImpls, getWorkerQueue()); @@ -1545,7 +1544,7 @@ cl_int MemCpyCommandHost::enqueueImp() { MDstReq.MMemoryRange, MDstReq.MAccessRange, MDstReq.MOffset, MDstReq.MElemSize, std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } EmptyCommand::EmptyCommand(QueueImplPtr Queue) @@ -1553,11 +1552,11 @@ EmptyCommand::EmptyCommand(QueueImplPtr Queue) emitInstrumentationDataProxy(); } -cl_int EmptyCommand::enqueueImp() { +pi_int32 EmptyCommand::enqueueImp() { waitForPreparedHostEvents(); waitForEvents(MQueue, MPreparedDepsEvents, MEvent->getHandleRef()); - return CL_SUCCESS; + return PI_SUCCESS; } void EmptyCommand::addRequirement(Command *DepCmd, AllocaCommandBase *AllocaCmd, @@ -2101,7 +2100,7 @@ void DispatchNativeKernel(void *Blob) { delete NDRDesc; } -cl_int enqueueImpKernel( +pi_int32 enqueueImpKernel( const QueueImplPtr &Queue, NDRDescT &NDRDesc, std::vector &Args, const std::shared_ptr &KernelBundleImplPtr, const std::shared_ptr &MSyclKernel, @@ -2193,7 +2192,7 @@ cl_int enqueueImpKernel( return PI_SUCCESS; } -cl_int ExecCGCommand::enqueueImp() { +pi_int32 ExecCGCommand::enqueueImp() { if (getCG().getType() != CG::CGTYPE::CodeplayHostTask) waitForPreparedHostEvents(); std::vector EventImpls = MPreparedDepsEvents; @@ -2223,7 +2222,7 @@ cl_int ExecCGCommand::enqueueImp() { Req->MAccessRange, Req->MAccessRange, /*DstOffset=*/{0, 0, 0}, Req->MElemSize, std::move(RawEvents), MEvent->getHandleRef()); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::CopyPtrToAcc: { CGCopy *Copy = (CGCopy *)MCommandGroup.get(); @@ -2240,7 +2239,7 @@ cl_int ExecCGCommand::enqueueImp() { MQueue, Req->MDims, Req->MMemoryRange, Req->MAccessRange, Req->MOffset, Req->MElemSize, std::move(RawEvents), MEvent->getHandleRef()); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::CopyAccToAcc: { CGCopy *Copy = (CGCopy *)MCommandGroup.get(); @@ -2258,7 +2257,7 @@ cl_int ExecCGCommand::enqueueImp() { ReqDst->MOffset, ReqDst->MElemSize, std::move(RawEvents), MEvent->getHandleRef()); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::Fill: { CGFill *Fill = (CGFill *)MCommandGroup.get(); @@ -2271,7 +2270,7 @@ cl_int ExecCGCommand::enqueueImp() { Req->MMemoryRange, Req->MAccessRange, Req->MOffset, Req->MElemSize, std::move(RawEvents), MEvent->getHandleRef()); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::RunOnHostIntel: { CGExecKernel *HostTask = (CGExecKernel *)MCommandGroup.get(); @@ -2317,7 +2316,7 @@ cl_int ExecCGCommand::enqueueImp() { } DispatchNativeKernel((void *)ArgsBlob.data()); - return CL_SUCCESS; + return PI_SUCCESS; } std::vector Buffers; @@ -2389,7 +2388,7 @@ cl_int ExecCGCommand::enqueueImp() { &NDRDesc.LocalSize[0], 0, nullptr, nullptr); } - return CL_SUCCESS; + return PI_SUCCESS; } auto getMemAllocationFunc = [this](Requirement *Req) { @@ -2421,14 +2420,14 @@ cl_int ExecCGCommand::enqueueImp() { MemoryManager::copy_usm(Copy->getSrc(), MQueue, Copy->getLength(), Copy->getDst(), std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::FillUSM: { CGFillUSM *Fill = (CGFillUSM *)MCommandGroup.get(); MemoryManager::fill_usm(Fill->getDst(), MQueue, Fill->getLength(), Fill->getFill(), std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::PrefetchUSM: { CGPrefetchUSM *Prefetch = (CGPrefetchUSM *)MCommandGroup.get(); @@ -2436,14 +2435,14 @@ cl_int ExecCGCommand::enqueueImp() { Prefetch->getLength(), std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::AdviseUSM: { CGAdviseUSM *Advise = (CGAdviseUSM *)MCommandGroup.get(); MemoryManager::advise_usm(Advise->getDst(), MQueue, Advise->getLength(), Advise->getAdvice(), std::move(RawEvents), Event); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::CodeplayInteropTask: { const detail::plugin &Plugin = MQueue->getPlugin(); @@ -2472,7 +2471,7 @@ cl_int ExecCGCommand::enqueueImp() { Plugin.call(MQueue->getHandleRef(), 0, nullptr, Event); - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::CodeplayHostTask: { CGHostTask *HostTask = static_cast(MCommandGroup.get()); @@ -2527,7 +2526,7 @@ cl_int ExecCGCommand::enqueueImp() { MShouldCompleteEventIfPossible = false; - return CL_SUCCESS; + return PI_SUCCESS; } case CG::CGTYPE::Barrier: { if (MQueue->get_device().is_host()) { diff --git a/sycl/source/detail/scheduler/commands.hpp b/sycl/source/detail/scheduler/commands.hpp index 75b2ae82ed3ef..0a0dfa8badf61 100644 --- a/sycl/source/detail/scheduler/commands.hpp +++ b/sycl/source/detail/scheduler/commands.hpp @@ -55,14 +55,14 @@ struct EnqueueResultT { SyclEnqueueFailed }; EnqueueResultT(ResultT Result = SyclEnqueueSuccess, Command *Cmd = nullptr, - cl_int ErrCode = CL_SUCCESS) + pi_int32 ErrCode = PI_SUCCESS) : MResult(Result), MCmd(Cmd), MErrCode(ErrCode) {} /// Indicates the result of enqueueing. ResultT MResult; /// Pointer to the command which failed to enqueue. Command *MCmd; /// Error code which is set when enqueueing fails. - cl_int MErrCode; + pi_int32 MErrCode; }; /// Dependency between two commands. @@ -238,7 +238,7 @@ class Command { std::vector &ToCleanUp); /// Private interface. Derived classes should implement this method. - virtual cl_int enqueueImp() = 0; + virtual pi_int32 enqueueImp() = 0; /// The type of the command. CommandType MType; @@ -334,7 +334,7 @@ class EmptyCommand : public Command { bool producesPiEvent() const final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; // Employing deque here as it allows to push_back/emplace_back without // invalidation of pointer or reference to stored data item regardless of @@ -354,7 +354,7 @@ class ReleaseCommand : public Command { bool supportsPostEnqueueCleanup() const final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; /// Command which allocates memory release command should dealocate. AllocaCommandBase *MAllocaCmd = nullptr; @@ -413,7 +413,7 @@ class AllocaCommand : public AllocaCommandBase { void emitInstrumentationData() override; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; /// The flag indicates that alloca should try to reuse pointer provided by /// the user during memory object construction. @@ -434,7 +434,7 @@ class AllocaSubBufCommand : public AllocaCommandBase { void emitInstrumentationData() override; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; AllocaCommandBase *MParentAlloca = nullptr; }; @@ -450,7 +450,7 @@ class MapMemObject : public Command { void emitInstrumentationData() override; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; AllocaCommandBase *MSrcAllocaCmd = nullptr; Requirement MSrcReq; @@ -470,7 +470,7 @@ class UnMapMemObject : public Command { bool producesPiEvent() const final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; AllocaCommandBase *MDstAllocaCmd = nullptr; Requirement MDstReq; @@ -493,7 +493,7 @@ class MemCpyCommand : public Command { bool producesPiEvent() const final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; QueueImplPtr MSrcQueue; Requirement MSrcReq; @@ -517,7 +517,7 @@ class MemCpyCommandHost : public Command { const QueueImplPtr &getWorkerQueue() const final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; QueueImplPtr MSrcQueue; Requirement MSrcReq; @@ -526,7 +526,7 @@ class MemCpyCommandHost : public Command { void **MDstPtr = nullptr; }; -cl_int enqueueImpKernel( +pi_int32 enqueueImpKernel( const QueueImplPtr &Queue, NDRDescT &NDRDesc, std::vector &Args, const std::shared_ptr &KernelBundleImplPtr, const std::shared_ptr &MSyclKernel, @@ -562,7 +562,7 @@ class ExecCGCommand : public Command { bool supportsPostEnqueueCleanup() const final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; AllocaCommandBase *getAllocaForReq(Requirement *Req); @@ -581,7 +581,7 @@ class UpdateHostRequirementCommand : public Command { void emitInstrumentationData() final; private: - cl_int enqueueImp() final; + pi_int32 enqueueImp() final; AllocaCommandBase *MSrcAllocaCmd = nullptr; Requirement MDstReq; diff --git a/sycl/source/exception.cpp b/sycl/source/exception.cpp index 12cbafd78a014..9ee88c57df0ad 100644 --- a/sycl/source/exception.cpp +++ b/sycl/source/exception.cpp @@ -65,7 +65,7 @@ exception::exception(context Ctx, int EV, const std::error_category &ECat) // protected base constructor for all SYCL 2020 constructors exception::exception(std::error_code EC, std::shared_ptr SharedPtrCtx, const std::string &WhatArg) - : MMsg(WhatArg + ReservedForErrorcode), MCLErr(PI_ERROR_INVALID_VALUE), + : MMsg(WhatArg + ReservedForErrorcode), MPIErr(PI_ERROR_INVALID_VALUE), MContext(SharedPtrCtx) { // For compatibility with previous implementation, we are "hiding" the // std::error_code in the MMsg string, behind the null string terminator @@ -111,7 +111,7 @@ context exception::get_context() const { return *MContext; } -cl_int exception::get_cl_code() const { return MCLErr; } +cl_int exception::get_cl_code() const { return MPIErr; } const std::error_category &sycl_category() noexcept { static const detail::SYCLCategory SYCLCategoryObj; diff --git a/sycl/source/handler.cpp b/sycl/source/handler.cpp index 3e8421cf7cdbd..3c0854e46685f 100644 --- a/sycl/source/handler.cpp +++ b/sycl/source/handler.cpp @@ -245,12 +245,12 @@ event handler::finalize() { auto EnqueueKernel = [&]() { // 'Result' for single point of return - cl_int Result = CL_INVALID_VALUE; + pi_int32 Result = PI_ERROR_INVALID_VALUE; if (MQueue->is_host()) { MHostKernel->call( MNDRDesc, (NewEvent) ? NewEvent->getHostProfilingInfo() : nullptr); - Result = CL_SUCCESS; + Result = PI_SUCCESS; } else { if (MQueue->getPlugin().getBackend() == backend::ext_intel_esimd_emulator) { @@ -258,14 +258,13 @@ event handler::finalize() { nullptr, reinterpret_cast(MHostKernel->getPtr()), MNDRDesc.Dims, &MNDRDesc.GlobalOffset[0], &MNDRDesc.GlobalSize[0], &MNDRDesc.LocalSize[0], 0, nullptr, nullptr); - Result = CL_SUCCESS; + Result = PI_SUCCESS; } else { Result = enqueueImpKernel(MQueue, MNDRDesc, MArgs, KernelBundleImpPtr, MKernel, MKernelName, MOSModuleHandle, RawEvents, OutEvent, nullptr); } } - // assert(Result != CL_INVALID_VALUE); return Result; }; @@ -280,7 +279,7 @@ event handler::finalize() { } if (DiscardEvent) { - if (CL_SUCCESS != EnqueueKernel()) + if (PI_SUCCESS != EnqueueKernel()) throw runtime_error("Enqueue process failed.", PI_ERROR_INVALID_OPERATION); } else { @@ -288,7 +287,7 @@ event handler::finalize() { NewEvent->setContextImpl(MQueue->getContextImplPtr()); OutEvent = &NewEvent->getHandleRef(); - if (CL_SUCCESS != EnqueueKernel()) + if (PI_SUCCESS != EnqueueKernel()) throw runtime_error("Enqueue process failed.", PI_ERROR_INVALID_OPERATION); else if (NewEvent->is_host() || NewEvent->getHandleRef() == nullptr) diff --git a/sycl/tools/sycl-trace/pi_trace_collector.cpp b/sycl/tools/sycl-trace/pi_trace_collector.cpp index d4fe0bcb7f3d6..b1489100cc3c7 100644 --- a/sycl/tools/sycl-trace/pi_trace_collector.cpp +++ b/sycl/tools/sycl-trace/pi_trace_collector.cpp @@ -37,84 +37,13 @@ static std::function *ResultPrinter = nullptr; static std::string getResult(pi_result Res) { switch (Res) { - case PI_SUCCESS: - return "PI_SUCCESS"; - case PI_ERROR_INVALID_KERNEL_NAME: - return "PI_ERROR_INVALID_KERNEL_NAME"; - case PI_ERROR_INVALID_OPERATION: - return "CL_INVALID_OPERATION"; - case PI_ERROR_INVALID_KERNEL: - return "PI_ERROR_INVALID_KERNEL"; - case PI_ERROR_INVALID_QUEUE_PROPERTIES: - return "PI_ERROR_INVALID_QUEUE_PROPERTIES"; - case PI_ERROR_INVALID_VALUE: - return "PI_ERROR_INVALID_VALUE"; - case PI_ERROR_INVALID_CONTEXT: - return "PI_ERROR_INVALID_CONTEXT"; - case PI_ERROR_INVALID_PLATFORM: - return "PI_ERROR_INVALID_PLATFORM"; - case PI_ERROR_INVALID_DEVICE: - return "PI_ERROR_INVALID_DEVICE"; - case PI_ERROR_INVALID_BINARY: - return "PI_ERROR_INVALID_BINARY"; - case PI_ERROR_INVALID_QUEUE: - return "PI_INVALID_COMMAND_QUEUE"; - case PI_ERROR_OUT_OF_HOST_MEMORY: - return "PI_ERROR_OUT_OF_HOST_MEMORY"; - case PI_ERROR_INVALID_PROGRAM: - return "PI_ERROR_INVALID_PROGRAM"; - case PI_ERROR_INVALID_PROGRAM_EXECUTABLE: - return "PI_ERROR_INVALID_PROGRAM_EXECUTABLE"; - case PI_ERROR_INVALID_SAMPLER: - return "PI_ERROR_INVALID_SAMPLER"; - case PI_ERROR_INVALID_BUFFER_SIZE: - return "PI_ERROR_INVALID_BUFFER_SIZE"; - case PI_ERROR_INVALID_MEM_OBJECT: - return "PI_ERROR_INVALID_MEM_OBJECT"; - case PI_ERROR_OUT_OF_RESOURCES: - return "PI_ERROR_OUT_OF_RESOURCES"; - case PI_ERROR_INVALID_EVENT: - return "PI_ERROR_INVALID_EVENT"; - case PI_ERROR_INVALID_EVENT_WAIT_LIST: - return "PI_ERROR_INVALID_EVENT_WAIT_LIST"; - case PI_ERROR_MISALIGNED_SUB_BUFFER_OFFSET: - return "PI_ERROR_MISALIGNED_SUB_BUFFER_OFFSET"; - case PI_ERROR_BUILD_PROGRAM_FAILURE: - return "PI_ERROR_BUILD_PROGRAM_FAILURE"; - case PI_ERROR_INVALID_WORK_GROUP_SIZE: - return "PI_ERROR_INVALID_WORK_GROUP_SIZE"; - case PI_ERROR_COMPILER_NOT_AVAILABLE: - return "PI_ERROR_COMPILER_NOT_AVAILABLE"; - case PI_ERROR_PROFILING_INFO_NOT_AVAILABLE: - return "PI_ERROR_PROFILING_INFO_NOT_AVAILABLE"; - case PI_ERROR_DEVICE_NOT_FOUND: - return "PI_ERROR_DEVICE_NOT_FOUND"; - case PI_ERROR_INVALID_WORK_ITEM_SIZE: - return "PI_ERROR_INVALID_WORK_ITEM_SIZE"; - case PI_ERROR_INVALID_WORK_DIMENSION: - return "PI_ERROR_INVALID_WORK_DIMENSION"; - case PI_ERROR_INVALID_KERNEL_ARGS: - return "PI_ERROR_INVALID_KERNEL_ARGS"; - case PI_ERROR_INVALID_IMAGE_SIZE: - return "PI_ERROR_INVALID_IMAGE_SIZE"; - case PI_ERROR_INVALID_ARG_VALUE: - return "PI_ERROR_INVALID_ARG_VALUE"; - case PI_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR: - return "PI_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR"; - case PI_ERROR_IMAGE_FORMAT_NOT_SUPPORTED: - return "PI_ERROR_IMAGE_FORMAT_NOT_SUPPORTED"; - case PI_ERROR_MEM_OBJECT_ALLOCATION_FAILURE: - return "PI_ERROR_MEM_OBJECT_ALLOCATION_FAILURE"; - case PI_ERROR_LINK_PROGRAM_FAILURE: - return "PI_ERROR_LINK_PROGRAM_FAILURE"; - case PI_ERROR_COMMAND_EXECUTION_FAILURE: - return "PI_ERROR_COMMAND_EXECUTION_FAILURE"; - case PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE: - return "PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE"; - case PI_ERROR_PLUGIN_SPECIFIC_ERROR: - return "PI_ERROR_PLUGIN_SPECIFIC_ERROR"; - case PI_ERROR_UNKNOWN: - return "PI_ERROR_UNKNOWN"; +#define _PI_ERRC(NAME, VAL) \ + case NAME: \ + return #NAME; +#define _PI_ERRC_WITH_MSG(NAME, VAL, MSG) _PI_ERRC(NAME, VAL) +#include +#undef _PI_ERRC +#undef _PI_ERRC_WITH_MSG } return "UNKNOWN RESULT"; diff --git a/sycl/unittests/SYCL2020/KernelID.cpp b/sycl/unittests/SYCL2020/KernelID.cpp index 4ea190d11290a..add7f9d1097f5 100644 --- a/sycl/unittests/SYCL2020/KernelID.cpp +++ b/sycl/unittests/SYCL2020/KernelID.cpp @@ -329,7 +329,7 @@ TEST(KernelID, InvalidKernelName) { throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { EXPECT_EQ(std::string("No kernel found with the specified name -46 " - "(CL_INVALID_KERNEL_NAME)"), + "(PI_ERROR_INVALID_KERNEL_NAME)"), e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; diff --git a/sycl/unittests/allowlist/ParseAllowList.cpp b/sycl/unittests/allowlist/ParseAllowList.cpp index 0d2a8edb91ba7..01f746a31ca43 100644 --- a/sycl/unittests/allowlist/ParseAllowList.cpp +++ b/sycl/unittests/allowlist/ParseAllowList.cpp @@ -49,11 +49,12 @@ TEST(ParseAllowListTests, CheckUnsupportedKeyNameIsHandledInSingleDeviceDesc) { "BackendName:level_zero,SomeUnsupportedKey:gpu"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " - "details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " + "details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/doc/" + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -67,11 +68,12 @@ TEST( "DriverVersion:{{value}}|SomeUnsupportedKey:gpu"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " - "details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " + "details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/doc/" + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -85,11 +87,12 @@ TEST( "BackendName:level_zero|SomeUnsupportedKey:gpu"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " - "details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " + "details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/doc/" + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -102,11 +105,12 @@ TEST(ParseAllowListTests, "DriverVersion:{{value1}}|SomeUnsupportedKey:{{value2}}"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " - "details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("Unrecognized key in SYCL_DEVICE_ALLOWLIST. For " + "details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/doc/" + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -129,11 +133,10 @@ TEST(ParseAllowListTests, CheckMissingOpenDoubleCurlyBracesAreHandled) { "DeviceName:regex1}},DriverVersion:{{regex1|regex2}}"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ( - std::string( - "Key DeviceName of SYCL_DEVICE_ALLOWLIST " - "should have value which starts with {{ -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ(std::string("Key DeviceName of SYCL_DEVICE_ALLOWLIST " + "should have value which starts with {{ -30 " + "(PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -145,11 +148,10 @@ TEST(ParseAllowListTests, CheckMissingClosedDoubleCurlyBracesAreHandled) { "DeviceName:{{regex1}},DriverVersion:{{regex1|regex2"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ( - std::string( - "Key DriverVersion of SYCL_DEVICE_ALLOWLIST " - "should have value which ends with }} -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ(std::string("Key DriverVersion of SYCL_DEVICE_ALLOWLIST " + "should have value which ends with }} -30 " + "(PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -195,11 +197,12 @@ TEST(ParseAllowListTests, CheckIncorrectBackendNameValueIsHandled) { sycl::detail::parseAllowList("BackendName:blablabla"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("Value blablabla for key BackendName is not valid in " - "SYCL_DEVICE_ALLOWLIST. For details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("Value blablabla for key BackendName is not valid in " + "SYCL_DEVICE_ALLOWLIST. For details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/doc/" + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -211,11 +214,12 @@ TEST(ParseAllowListTests, CheckIncorrectDeviceTypeValueIsHandled) { sycl::detail::parseAllowList("DeviceType:blablabla"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("Value blablabla for key DeviceType is not valid in " - "SYCL_DEVICE_ALLOWLIST. For details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("Value blablabla for key DeviceType is not valid in " + "SYCL_DEVICE_ALLOWLIST. For details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/doc/" + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; } @@ -232,7 +236,7 @@ TEST(ParseAllowListTests, CheckIncorrectDeviceVendorIdValueIsHandled) { "SYCL_DEVICE_ALLOWLIST. It should have the hex format. For " "details, please refer to " "https://github.com/intel/llvm/blob/sycl/sycl/doc/" - "EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), + "EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; @@ -259,11 +263,12 @@ TEST(ParseAllowListTests, CheckExceptionIsThrownForValueWOColonDelim) { sycl::detail::parseAllowList("SomeValueWOColonDelimiter"); throw std::logic_error("sycl::runtime_error didn't throw"); } catch (sycl::runtime_error const &e) { - EXPECT_EQ(std::string("SYCL_DEVICE_ALLOWLIST has incorrect format. For " - "details, please refer to " - "https://github.com/intel/llvm/blob/sycl/sycl/" - "doc/EnvironmentVariables.md -30 (CL_INVALID_VALUE)"), - e.what()); + EXPECT_EQ( + std::string("SYCL_DEVICE_ALLOWLIST has incorrect format. For " + "details, please refer to " + "https://github.com/intel/llvm/blob/sycl/sycl/" + "doc/EnvironmentVariables.md -30 (PI_ERROR_INVALID_VALUE)"), + e.what()); } catch (...) { FAIL() << "Expected sycl::runtime_error"; }