File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
unified-runtime/source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -752,10 +752,24 @@ ur_result_t urKernelGetInfo(
752752 case UR_KERNEL_INFO_NUM_ARGS:
753753 return ReturnValue (uint32_t {Kernel->ZeKernelProperties ->numKernelArgs });
754754 case UR_KERNEL_INFO_SPILL_MEM_SIZE: {
755- std::vector<uint32_t > spills = {
756- uint32_t {Kernel->ZeKernelProperties ->spillMemSize }};
757- return ReturnValue (static_cast <const uint32_t *>(spills.data ()),
758- spills.size ());
755+ try {
756+ std::vector<uint32_t > Spills;
757+ Spills.reserve (Kernel->ZeKernels .size ());
758+ for (auto &ZeKernel : Kernel->ZeKernels ) {
759+ ze_kernel_properties_t props;
760+ props.stype = ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES;
761+ props.pNext = nullptr ;
762+ ZE2UR_CALL (zeKernelGetProperties, (ZeKernel, &props));
763+ uint32_t spillMemSize = props.spillMemSize ;
764+ Spills.push_back (spillMemSize);
765+ }
766+ return ReturnValue (static_cast <const uint32_t *>(Spills.data ()),
767+ Spills.size ());
768+ } catch (const std::bad_alloc &) {
769+ return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
770+ } catch (...) {
771+ return UR_RESULT_ERROR_UNKNOWN;
772+ }
759773 }
760774 case UR_KERNEL_INFO_REFERENCE_COUNT:
761775 return ReturnValue (uint32_t {Kernel->RefCount .load ()});
You can’t perform that action at this time.
0 commit comments