diff --git a/src/gpu/intel/ocl/ocl_gpu_hw_info.cpp b/src/gpu/intel/ocl/ocl_gpu_hw_info.cpp index 202deb77d50..fbc99165414 100644 --- a/src/gpu/intel/ocl/ocl_gpu_hw_info.cpp +++ b/src/gpu/intel/ocl/ocl_gpu_hw_info.cpp @@ -55,7 +55,7 @@ xpu::runtime_version_t get_driver_version(cl_device_id device) { return runtime_version; } -void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device, +status_t init_gpu_hw_info(impl::engine_t *engine, cl_device_id device, cl_context context, uint32_t &ip_version, compute::gpu_arch_t &gpu_arch, int &gpu_product_family, int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic, bool &mayiuse_ngen_kernels) { @@ -71,23 +71,18 @@ void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device, stepping_id = product.stepping; mayiuse_systolic = false; - status_t ret - = get_ocl_device_enabled_systolic_intel(device, mayiuse_systolic); - assert(ret == CL_SUCCESS); - ret = get_ocl_device_enabled_native_float_atomics( - device, native_extensions, is_xelpg); - assert(ret == CL_SUCCESS); - MAYBE_UNUSED(ret); + CHECK(get_ocl_device_enabled_systolic_intel(device, mayiuse_systolic)); + CHECK(get_ocl_device_enabled_native_float_atomics( + device, native_extensions, is_xelpg)); auto status = jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine); if (status != status::success) mayiuse_ngen_kernels = false; ip_version = 0; - if (clGetDeviceInfo(device, CL_DEVICE_IP_VERSION_INTEL, sizeof(ip_version), - &ip_version, nullptr) - != CL_SUCCESS) - ip_version = 0; + OCL_CHECK(clGetDeviceInfo(device, CL_DEVICE_IP_VERSION_INTEL, + sizeof(ip_version), &ip_version, nullptr)); + return status::success; } } // namespace ocl diff --git a/src/gpu/intel/ocl/ocl_gpu_hw_info.hpp b/src/gpu/intel/ocl/ocl_gpu_hw_info.hpp index ec16482ca87..2a9e5112ec6 100644 --- a/src/gpu/intel/ocl/ocl_gpu_hw_info.hpp +++ b/src/gpu/intel/ocl/ocl_gpu_hw_info.hpp @@ -30,7 +30,7 @@ namespace ocl { xpu::runtime_version_t get_driver_version(cl_device_id device); -void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device, +status_t init_gpu_hw_info(impl::engine_t *engine, cl_device_id device, cl_context context, uint32_t &ip_version, compute::gpu_arch_t &gpu_arch, int &gpu_product_family, int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic, bool &mayiuse_ngen_kernels); diff --git a/src/gpu/intel/sycl/device_info.cpp b/src/gpu/intel/sycl/device_info.cpp index 222a2b5257b..e33767fe887 100644 --- a/src/gpu/intel/sycl/device_info.cpp +++ b/src/gpu/intel/sycl/device_info.cpp @@ -43,6 +43,7 @@ status_t device_info_t::init_arch(impl::engine_t *engine) { // skip other vendors if (!xpu::sycl::is_intel_device(device)) return status::success; + auto status = status::success; auto be = xpu::sycl::get_backend(device); if (be == xpu::sycl::backend_t::opencl) { auto ocl_dev = xpu::sycl::compat::get_native(device); @@ -51,7 +52,7 @@ status_t device_info_t::init_arch(impl::engine_t *engine) { auto ocl_ctx = xpu::sycl::compat::get_native(ctx); auto ocl_ctx_wrapper = xpu::ocl::make_wrapper(ocl_ctx); - gpu::intel::ocl::init_gpu_hw_info(engine, ocl_dev_wrapper, + status = gpu::intel::ocl::init_gpu_hw_info(engine, ocl_dev_wrapper, ocl_ctx_wrapper, ip_version_, gpu_arch_, gpu_product_family_, stepping_id_, native_extensions_, mayiuse_systolic_, mayiuse_ngen_kernels_); @@ -59,14 +60,15 @@ status_t device_info_t::init_arch(impl::engine_t *engine) { auto ze_dev = xpu::sycl::compat::get_native(device); auto ze_ctx = xpu::sycl::compat::get_native(ctx); - gpu::intel::sycl::init_gpu_hw_info(engine, ze_dev, ze_ctx, ip_version_, + status = gpu::intel::sycl::init_gpu_hw_info(engine, ze_dev, ze_ctx, ip_version_, gpu_arch_, gpu_product_family_, stepping_id_, native_extensions_, mayiuse_systolic_, mayiuse_ngen_kernels_); } else { assert(!"not_expected"); + status = status::unimplemented; } - return status::success; + return status; } status_t device_info_t::init_device_name(impl::engine_t *engine) { diff --git a/src/gpu/intel/sycl/l0/utils.cpp b/src/gpu/intel/sycl/l0/utils.cpp index 310e818fa65..0bfa92ba610 100644 --- a/src/gpu/intel/sycl/l0/utils.cpp +++ b/src/gpu/intel/sycl/l0/utils.cpp @@ -366,7 +366,7 @@ status_t get_l0_device_eu_count(ze_device_handle_t device, int &eucount) { return status::success; } -void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device, +status_t init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device, ze_context_handle_t context, uint32_t &ip_version, compute::gpu_arch_t &gpu_arch, int &gpu_product_family, int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic, @@ -382,18 +382,16 @@ void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device, stepping_id = product.stepping; mayiuse_systolic = false; - status_t ret - = get_l0_device_enabled_systolic_intel(device, mayiuse_systolic); + CHECK(get_l0_device_enabled_systolic_intel(device, mayiuse_systolic)); // TODO: xelpg has no f64 support. check that the query properly handle that - ret = get_l0_device_enabled_native_float_atomics(device, native_extensions); - MAYBE_UNUSED(ret); + CHECK(get_l0_device_enabled_native_float_atomics(device, native_extensions)); auto status = jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine); if (status != status::success) mayiuse_ngen_kernels = false; ip_version = 0; - get_device_ip(device, ip_version); + return get_device_ip(device, ip_version); } } // namespace sycl diff --git a/src/gpu/intel/sycl/l0/utils.hpp b/src/gpu/intel/sycl/l0/utils.hpp index 130ea875aac..5aac7e0004a 100644 --- a/src/gpu/intel/sycl/l0/utils.hpp +++ b/src/gpu/intel/sycl/l0/utils.hpp @@ -45,7 +45,7 @@ bool compare_ze_devices(const ::sycl::device &lhs, const ::sycl::device &rhs); status_t func_zeModuleGetNativeBinary(ze_module_handle_t hModule, size_t *pSize, uint8_t *pModuleNativeBinary); -void init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device, +status_t init_gpu_hw_info(impl::engine_t *engine, ze_device_handle_t device, ze_context_handle_t context, uint32_t &ip_version, compute::gpu_arch_t &gpu_arch, int &gpu_product_family, int &stepping_id, uint64_t &native_extensions, bool &mayiuse_systolic,