mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 07:39:01 +00:00
Limit buffers sizes to leave some memory for the platform (#1172)
Some conformance tests use directly the size returned by the runtime for max memory size to allocate buffers. This doesn't leave enough memory for the system to run the tests.
This commit is contained in:
@@ -48,4 +48,16 @@ std::string get_device_name(cl_device_id device);
|
||||
// Returns the maximum size in bytes for Kernel Parameters
|
||||
size_t get_max_param_size(cl_device_id device);
|
||||
|
||||
/* We need to use a portion of available alloc size,
|
||||
* divide it to leave some memory for the platform. */
|
||||
#define MAX_DEVICE_MEMORY_SIZE_DIVISOR (2)
|
||||
|
||||
/* Get max allocation size. */
|
||||
cl_ulong get_device_info_max_mem_alloc_size(cl_device_id device,
|
||||
unsigned int divisor = 1);
|
||||
cl_ulong get_device_info_global_mem_size(cl_device_id device,
|
||||
unsigned int divisor = 1);
|
||||
cl_ulong get_device_info_max_constant_buffer_size(cl_device_id device,
|
||||
unsigned int divisor = 1);
|
||||
|
||||
#endif // _deviceInfo_h
|
||||
|
||||
Reference in New Issue
Block a user