From 0d6bc095d4f2b6b3392d76200fce6bd85a80409e Mon Sep 17 00:00:00 2001 From: amochalo Date: Thu, 27 Feb 2020 18:27:22 +0300 Subject: [PATCH 01/11] [SYCL] Improve error handling Improve error handling in enqueue_kernel_launch::handleError. https://github.com/intel/llvm/issues/935 Signed-off-by: amochalo --- .../detail/error_handling/enqueue_kernel.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index ded4d1e6c8e71..7222b1bb303ce 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -177,7 +177,6 @@ bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, const plugin &Plugin = DeviceImpl.getPlugin(); RT::PiDevice Device = DeviceImpl.getHandleRef(); - if (HasLocalSize) { size_t MaxThreadsPerBlock[3] = {}; Plugin.call( @@ -211,6 +210,27 @@ bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, "PI backend failed. PI backend returns: " + codeToString(Error), Error); } +bool handleInvalidWorkItemSize(const device_impl &DeviceImpl, + const NDRDescT &NDRDesc) { + + const plugin &Plugin = DeviceImpl.getPlugin(); + RT::PiDevice Device = DeviceImpl.getHandleRef(); + + size_t MaxWISize[] = {0, 0, 0}; + + Plugin.call(Device, PI_DEVICE_MAX_WORK_ITEM_SIZE, + sizeof(MaxWISize), &MaxWISize, + nullptr); + for (int i = 0; i < NDRDesc.Dims; i++) { + if (NDRDesc.LocalSize[i] > MaxWISize[i]) + throw sycl::nd_range_error("Number of local work group number " + + std::to_string(i) + + " greater then corresponding values" + "PI_DEVISE_MAX_WORK_SIZE", + PI_INVALID_WORK_ITEM_SIZE); + } +} + bool handleError(pi_result Error, const device_impl &DeviceImpl, pi_kernel Kernel, const NDRDescT &NDRDesc) { assert(Error != PI_SUCCESS && From 2a41dfa49bd8a17374b9b13ecefbd9f441943b5d Mon Sep 17 00:00:00 2001 From: amochalo Date: Thu, 27 Feb 2020 17:56:15 +0300 Subject: [PATCH 02/11] small fix Signed-off-by: amochalo --- sycl/include/CL/sycl/detail/pi.h | 5 ++ .../detail/error_handling/enqueue_kernel.cpp | 57 +++++++++++++++---- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 507f15fbd03ad..7f18984f623dd 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -83,9 +83,14 @@ typedef enum { PI_COMPILER_NOT_AVAILABLE = CL_COMPILER_NOT_AVAILABLE, PI_PROFILING_INFO_NOT_AVAILABLE = CL_PROFILING_INFO_NOT_AVAILABLE, PI_DEVICE_NOT_FOUND = CL_DEVICE_NOT_FOUND, + PI_INVALID_WORK_ITEM_SIZE=CL_INVALID_WORK_ITEM_SIZE, + PI_INVALID_KERNEL_ARGS=CL_INVALID_KERNEL_ARGS, + PI_IMAGE_FORMAT_NOT_SUPPORTED=CL_IMAGE_FORMAT_NOT_SUPPORTED, + PI_MEM_OBJECT_ALLOCATION_FAILURE=CL_MEM_OBJECT_ALLOCATION_FAILURE, PI_ERROR_UNKNOWN = -999 } _pi_result; + typedef enum { PI_EVENT_COMPLETE = CL_COMPLETE, PI_EVENT_RUNNING = CL_RUNNING, diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index 7222b1bb303ce..bb220a3decbf4 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -159,16 +159,17 @@ bool oclHandleInvalidWorkGroupSize(const device_impl &DeviceImpl, } } } + +// TODO: required number of sub-groups, OpenCL 2.1: +// CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and is not +// consistent with the required number of sub-groups for kernel in the +// program source. - // TODO: required number of sub-groups, OpenCL 2.1: - // PI_INVALID_WORK_GROUP_SIZE if local_work_size is specified and is not - // consistent with the required number of sub-groups for kernel in the - // program source. +//Fallback - // Fallback constexpr pi_result Error = PI_INVALID_WORK_GROUP_SIZE; throw runtime_error( - "OpenCL API failed. OpenCL API returns: " + codeToString(Error), Error); + "OpenCL API failed. OpenCL API returns: " + codeToString(Error), Error); } bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, @@ -218,9 +219,9 @@ bool handleInvalidWorkItemSize(const device_impl &DeviceImpl, size_t MaxWISize[] = {0, 0, 0}; - Plugin.call(Device, PI_DEVICE_MAX_WORK_ITEM_SIZE, - sizeof(MaxWISize), &MaxWISize, - nullptr); + Plugin.call( + Device, PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, sizeof(MaxWISize), &MaxWISize, + nullptr); for (int i = 0; i < NDRDesc.Dims; i++) { if (NDRDesc.LocalSize[i] > MaxWISize[i]) throw sycl::nd_range_error("Number of local work group number " + @@ -238,7 +239,43 @@ bool handleError(pi_result Error, const device_impl &DeviceImpl, switch (Error) { case PI_INVALID_WORK_GROUP_SIZE: return handleInvalidWorkGroupSize(DeviceImpl, Kernel, NDRDesc); - // TODO: Handle other error codes + + case PI_INVALID_KERNEL_ARGS: + throw sycl::nd_range_error( + "The kernel argument values have not been specified " + " OR " + "a kernel argument declared to be a pointer to a type" + " does not point to a named address space", + PI_INVALID_KERNEL_ARGS); + + case PI_INVALID_WORK_ITEM_SIZE: + return handleInvalidWorkItemSize(DeviceImpl, NDRDesc); + + case PI_IMAGE_FORMAT_NOT_SUPPORTED: + throw sycl::nd_range_error( + "image object is specified as an argument value" + " and the image format is not supported by device associated" + " with queue", + PI_IMAGE_FORMAT_NOT_SUPPORTED); + + case PI_MISALIGNED_SUB_BUFFER_OFFSET: + throw sycl::nd_range_error( + "a sub-buffer object is specified as the value for an argument " + " that is a buffer object and the offset specified " + "when the sub-buffer object is created is not aligned " + "to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated" + " with queue", + PI_MISALIGNED_SUB_BUFFER_OFFSET); + + case PI_MEM_OBJECT_ALLOCATION_FAILURE: + throw sycl::nd_range_error( + "failure to allocate memory for data store associated with image" + " or " + "buffer objects specified as arguments to kernel", + PI_MEM_OBJECT_ALLOCATION_FAILURE); + + // TODO: Handle other error codes + default: throw runtime_error( "OpenCL API failed. OpenCL API returns: " + codeToString(Error), Error); From e0324d7b4cd3db9e9f08c15862f158926aa8aa40 Mon Sep 17 00:00:00 2001 From: amochalo Date: Thu, 27 Feb 2020 19:36:55 +0300 Subject: [PATCH 03/11] Clang-format fix Signed-off-by: amochalo --- sycl/include/CL/sycl/detail/pi.h | 9 ++++----- .../detail/error_handling/enqueue_kernel.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 7f18984f623dd..9d7d6761f67fb 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -83,14 +83,13 @@ typedef enum { PI_COMPILER_NOT_AVAILABLE = CL_COMPILER_NOT_AVAILABLE, PI_PROFILING_INFO_NOT_AVAILABLE = CL_PROFILING_INFO_NOT_AVAILABLE, PI_DEVICE_NOT_FOUND = CL_DEVICE_NOT_FOUND, - PI_INVALID_WORK_ITEM_SIZE=CL_INVALID_WORK_ITEM_SIZE, - PI_INVALID_KERNEL_ARGS=CL_INVALID_KERNEL_ARGS, - PI_IMAGE_FORMAT_NOT_SUPPORTED=CL_IMAGE_FORMAT_NOT_SUPPORTED, - PI_MEM_OBJECT_ALLOCATION_FAILURE=CL_MEM_OBJECT_ALLOCATION_FAILURE, + PI_INVALID_WORK_ITEM_SIZE = CL_INVALID_WORK_ITEM_SIZE, + PI_INVALID_KERNEL_ARGS = CL_INVALID_KERNEL_ARGS, + PI_IMAGE_FORMAT_NOT_SUPPORTED = CL_IMAGE_FORMAT_NOT_SUPPORTED, + PI_MEM_OBJECT_ALLOCATION_FAILURE = CL_MEM_OBJECT_ALLOCATION_FAILURE, PI_ERROR_UNKNOWN = -999 } _pi_result; - typedef enum { PI_EVENT_COMPLETE = CL_COMPLETE, PI_EVENT_RUNNING = CL_RUNNING, diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index bb220a3decbf4..df500d2da0fc5 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -159,17 +159,17 @@ bool oclHandleInvalidWorkGroupSize(const device_impl &DeviceImpl, } } } - -// TODO: required number of sub-groups, OpenCL 2.1: -// CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and is not -// consistent with the required number of sub-groups for kernel in the -// program source. -//Fallback + // TODO: required number of sub-groups, OpenCL 2.1: + // CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and is not + // consistent with the required number of sub-groups for kernel in the + // program source. + + // Fallback constexpr pi_result Error = PI_INVALID_WORK_GROUP_SIZE; throw runtime_error( - "OpenCL API failed. OpenCL API returns: " + codeToString(Error), Error); + "OpenCL API failed. OpenCL API returns: " + codeToString(Error), Error); } bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, From 6d4819fb341e5f923dec7be8505d74d8e30b58cc Mon Sep 17 00:00:00 2001 From: amochalo Date: Thu, 27 Feb 2020 19:42:29 +0300 Subject: [PATCH 04/11] Clang-format fix Signed-off-by: amochalo --- sycl/include/CL/sycl/detail/pi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 9d7d6761f67fb..5bef1882d4581 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -102,7 +102,7 @@ typedef enum { PI_PLATFORM_INFO_NAME = CL_PLATFORM_NAME, PI_PLATFORM_INFO_PROFILE = CL_PLATFORM_PROFILE, PI_PLATFORM_INFO_VENDOR = CL_PLATFORM_VENDOR, - PI_PLATFORM_INFO_VERSION = CL_PLATFORM_VERSION, + PI_PLATFORM_INFO_VERSION = CL_PLATFORM_VERSION } _pi_platform_info; typedef enum { From fea2cf9a1bcc19a5ca96627d29fe727be20fa45f Mon Sep 17 00:00:00 2001 From: amochalo Date: Fri, 28 Feb 2020 15:49:53 +0300 Subject: [PATCH 05/11] Apply comments Signed-off-by: amochalo --- sycl/source/detail/error_handling/enqueue_kernel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index df500d2da0fc5..1295e357e9fb1 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -161,7 +161,7 @@ bool oclHandleInvalidWorkGroupSize(const device_impl &DeviceImpl, } // TODO: required number of sub-groups, OpenCL 2.1: - // CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and is not + // PI_INVALID_WORK_GROUP_SIZE if local_work_size is specified and is not // consistent with the required number of sub-groups for kernel in the // program source. @@ -224,12 +224,12 @@ bool handleInvalidWorkItemSize(const device_impl &DeviceImpl, nullptr); for (int i = 0; i < NDRDesc.Dims; i++) { if (NDRDesc.LocalSize[i] > MaxWISize[i]) - throw sycl::nd_range_error("Number of local work group number " + - std::to_string(i) + - " greater then corresponding values" - "PI_DEVISE_MAX_WORK_SIZE", - PI_INVALID_WORK_ITEM_SIZE); + throw sycl::nd_range_error( + "Number of work-items in a work-group exceed limit for dimension " + "{i}: {NDRDesc.LocalSize[i]} > {MaxWISize[i]}", + PI_INVALID_WORK_ITEM_SIZE); } + return 0; } bool handleError(pi_result Error, const device_impl &DeviceImpl, From ae72a628e7244b717e4e6c04f1b33a7859c5895a Mon Sep 17 00:00:00 2001 From: amochalo Date: Fri, 28 Feb 2020 16:02:36 +0300 Subject: [PATCH 06/11] Apply comment Signed-off-by: amochalo --- sycl/include/CL/sycl/detail/pi.h | 2 +- sycl/source/detail/program_impl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 5bef1882d4581..6987171c42ad9 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -61,7 +61,7 @@ using pi_bitfield = pi_uint64; // typedef enum { PI_SUCCESS = CL_SUCCESS, - PI_RESULT_INVALID_KERNEL_NAME = CL_INVALID_KERNEL_NAME, + PI_INVALID_KERNEL_NAME = CL_INVALID_KERNEL_NAME, PI_INVALID_OPERATION = CL_INVALID_OPERATION, PI_INVALID_KERNEL = CL_INVALID_KERNEL, PI_INVALID_QUEUE_PROPERTIES = CL_INVALID_QUEUE_PROPERTIES, diff --git a/sycl/source/detail/program_impl.cpp b/sycl/source/detail/program_impl.cpp index a59f2414e11d0..9785e689fd600 100644 --- a/sycl/source/detail/program_impl.cpp +++ b/sycl/source/detail/program_impl.cpp @@ -380,7 +380,7 @@ RT::PiKernel program_impl::get_pi_kernel(const string_class &KernelName) const { const detail::plugin &Plugin = getPlugin(); RT::PiResult Err = Plugin.call_nocheck( MProgram, KernelName.c_str(), &Kernel); - if (Err == PI_RESULT_INVALID_KERNEL_NAME) { + if (Err == PI_INVALID_KERNEL_NAME) { throw invalid_object_error( "This instance of program does not contain the kernel requested", Err); From 00cc41630186141a2064524b2709e0bdd016663d Mon Sep 17 00:00:00 2001 From: amochalo Date: Tue, 10 Mar 2020 12:17:50 +0300 Subject: [PATCH 07/11] Some fix (rebase branch) Signed-off-by: amochalo --- sycl/source/detail/program_manager/program_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index d9719547c7a0c..9e676045e8d08 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -909,7 +909,7 @@ ProgramManager::getKernelSetId(OSModuleHandle M, return ModuleKSIdIt->second; throw runtime_error("No kernel named " + KernelName + " was found", - PI_RESULT_INVALID_KERNEL_NAME); + PI_INVALID_KERNEL_NAME); } RT::PiDeviceBinaryType ProgramManager::getFormat(const DeviceImage &Img) const { From aaf766a33f69f4e69e278796618c5d5068e90247 Mon Sep 17 00:00:00 2001 From: amochalo Date: Wed, 11 Mar 2020 13:25:46 +0300 Subject: [PATCH 08/11] Small change Signed-off-by: amochalo --- sycl/source/detail/error_handling/enqueue_kernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index 1295e357e9fb1..af45c8d02a627 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -226,7 +226,7 @@ bool handleInvalidWorkItemSize(const device_impl &DeviceImpl, if (NDRDesc.LocalSize[i] > MaxWISize[i]) throw sycl::nd_range_error( "Number of work-items in a work-group exceed limit for dimension " - "{i}: {NDRDesc.LocalSize[i]} > {MaxWISize[i]}", + "{I}: {NDRDesc.LocalSize[I]} > {MaxWISize[I]}", PI_INVALID_WORK_ITEM_SIZE); } return 0; From 98842ec6490e8329b2d85986d14a051f18eb797b Mon Sep 17 00:00:00 2001 From: amochalo Date: Wed, 18 Mar 2020 15:51:19 +0300 Subject: [PATCH 09/11] Apply comments Signed-off-by: amochalo --- sycl/include/CL/sycl/detail/pi.h | 1 + .../source/detail/error_handling/enqueue_kernel.cpp | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index 6987171c42ad9..75cde167f0c65 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -85,6 +85,7 @@ typedef enum { PI_DEVICE_NOT_FOUND = CL_DEVICE_NOT_FOUND, PI_INVALID_WORK_ITEM_SIZE = CL_INVALID_WORK_ITEM_SIZE, PI_INVALID_KERNEL_ARGS = CL_INVALID_KERNEL_ARGS, + PI_INVALID_IMAGE_SIZE = CL_INVALID_IMAGE_SIZE, PI_IMAGE_FORMAT_NOT_SUPPORTED = CL_IMAGE_FORMAT_NOT_SUPPORTED, PI_MEM_OBJECT_ALLOCATION_FAILURE = CL_MEM_OBJECT_ALLOCATION_FAILURE, PI_ERROR_UNKNOWN = -999 diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index af45c8d02a627..cf81115317d7b 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -244,8 +244,7 @@ bool handleError(pi_result Error, const device_impl &DeviceImpl, throw sycl::nd_range_error( "The kernel argument values have not been specified " " OR " - "a kernel argument declared to be a pointer to a type" - " does not point to a named address space", + "a kernel argument declared to be a pointer to a type.", PI_INVALID_KERNEL_ARGS); case PI_INVALID_WORK_ITEM_SIZE: @@ -270,10 +269,16 @@ bool handleError(pi_result Error, const device_impl &DeviceImpl, case PI_MEM_OBJECT_ALLOCATION_FAILURE: throw sycl::nd_range_error( "failure to allocate memory for data store associated with image" - " or " - "buffer objects specified as arguments to kernel", + " or buffer objects specified as arguments to kernel", PI_MEM_OBJECT_ALLOCATION_FAILURE); + case PI_INVALID_IMAGE_SIZE: + throw sycl::nd_range_error( + "image object is specified as an argument value and the image " + "dimensions (image width, height, specified or compute row and/or " + "slice pitch) are not supported by device associated with queue", + PI_INVALID_IMAGE_SIZE); + // TODO: Handle other error codes default: From adf76053969c8a425d43499d63379dcad4d1fa85 Mon Sep 17 00:00:00 2001 From: amochalo Date: Wed, 25 Mar 2020 13:31:13 +0300 Subject: [PATCH 10/11] Apply comments Signed-off-by: amochalo --- sycl/source/detail/error_handling/enqueue_kernel.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index cf81115317d7b..977128caf3096 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -166,7 +166,6 @@ bool oclHandleInvalidWorkGroupSize(const device_impl &DeviceImpl, // program source. // Fallback - constexpr pi_result Error = PI_INVALID_WORK_GROUP_SIZE; throw runtime_error( "OpenCL API failed. OpenCL API returns: " + codeToString(Error), Error); @@ -178,6 +177,7 @@ bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel, const plugin &Plugin = DeviceImpl.getPlugin(); RT::PiDevice Device = DeviceImpl.getHandleRef(); + if (HasLocalSize) { size_t MaxThreadsPerBlock[3] = {}; Plugin.call( @@ -222,11 +222,12 @@ bool handleInvalidWorkItemSize(const device_impl &DeviceImpl, Plugin.call( Device, PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, sizeof(MaxWISize), &MaxWISize, nullptr); - for (int i = 0; i < NDRDesc.Dims; i++) { - if (NDRDesc.LocalSize[i] > MaxWISize[i]) + for (int I = 0; I < NDRDesc.Dims; I++) { + if (NDRDesc.LocalSize[I] > MaxWISize[I]) throw sycl::nd_range_error( - "Number of work-items in a work-group exceed limit for dimension " - "{I}: {NDRDesc.LocalSize[I]} > {MaxWISize[I]}", + "Number of work-items in a work-group exceed limit for dimension " + + std::to_string(I) + " : " + std::to_string(NDRDesc.LocalSize[I]) + + " > " + std::to_string(MaxWISize[I]), PI_INVALID_WORK_ITEM_SIZE); } return 0; From 1f0787e401194e45edbede6f34881326b982c80b Mon Sep 17 00:00:00 2001 From: amochalo Date: Mon, 6 Apr 2020 19:01:55 +0300 Subject: [PATCH 11/11] Resolve warning Signed-off-by: amochalo --- sycl/source/detail/error_handling/enqueue_kernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/error_handling/enqueue_kernel.cpp b/sycl/source/detail/error_handling/enqueue_kernel.cpp index 977128caf3096..f73c77b1d7649 100644 --- a/sycl/source/detail/error_handling/enqueue_kernel.cpp +++ b/sycl/source/detail/error_handling/enqueue_kernel.cpp @@ -222,7 +222,7 @@ bool handleInvalidWorkItemSize(const device_impl &DeviceImpl, Plugin.call( Device, PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, sizeof(MaxWISize), &MaxWISize, nullptr); - for (int I = 0; I < NDRDesc.Dims; I++) { + for (unsigned I = 0; I < NDRDesc.Dims; I++) { if (NDRDesc.LocalSize[I] > MaxWISize[I]) throw sycl::nd_range_error( "Number of work-items in a work-group exceed limit for dimension " +