0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd:🆑 Query to memoize warp sizes on init.

This commit is contained in:
Jason Volk 2022-09-27 12:23:43 -07:00
parent e85ed0e0dd
commit 508d27eb40

View file

@ -56,6 +56,9 @@ namespace ircd::cl
} }
api[PLATFORM_MAX][DEVICE_MAX]; api[PLATFORM_MAX][DEVICE_MAX];
static uint
warp_size[PLATFORM_MAX][DEVICE_MAX];
static cl_context static cl_context
primary; primary;
@ -442,6 +445,11 @@ ircd::cl::init::init_ctxs()
// For any inits in the work subsystem. // For any inits in the work subsystem.
work::init(); work::init();
// Save the warp/wavefront size.
for(size_t i(0); i < platforms; ++i)
for(size_t j(0); j < devices[i]; ++j)
warp_size[i][j] = query_warp_size(primary, device[i][j]);
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
return _devs; return _devs;
} }
@ -584,7 +592,7 @@ ircd::cl::log_dev_info(const uint i,
string_view{head}, string_view{head},
info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_CLOCK_FREQUENCY, buf[0]), info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_CLOCK_FREQUENCY, buf[0]),
info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_COMPUTE_UNITS, buf[1]), info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_COMPUTE_UNITS, buf[1]),
primary? query_warp_size(primary, dev): 0UL, warp_size[i][j],
info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_WORK_GROUP_SIZE, buf[2]), info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_WORK_GROUP_SIZE, buf[2]),
info<int>(clGetDeviceInfo, dev, CL_DEVICE_PARTITION_PROPERTIES, buf[3]), info<int>(clGetDeviceInfo, dev, CL_DEVICE_PARTITION_PROPERTIES, buf[3]),
info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, buf[4]), info<uint>(clGetDeviceInfo, dev, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, buf[4]),