Changeset View
Changeset View
Standalone View
Standalone View
src/device/opencl/device_opencl_impl.cpp
| Context not available. | |||||
| #ifdef WITH_OPENCL | #ifdef WITH_OPENCL | ||||
| # include "device/opencl/device_opencl.h" | # include "device/opencl/device_opencl.h" | ||||
| # include "device/device_debug.h" | |||||
| # include "kernel/kernel_types.h" | # include "kernel/kernel_types.h" | ||||
| # include "kernel/split/kernel_split_data_types.h" | # include "kernel/split/kernel_split_data_types.h" | ||||
| # include "util/util_algorithm.h" | # include "util/util_algorithm.h" | ||||
| # include "util/util_debug.h" | |||||
| # include "util/util_foreach.h" | # include "util/util_foreach.h" | ||||
| # include "util/util_logging.h" | # include "util/util_logging.h" | ||||
| # include "util/util_md5.h" | # include "util/util_md5.h" | ||||
| Context not available. | |||||
| clGetDeviceInfo( | clGetDeviceInfo( | ||||
| device->cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_buffer_size, NULL); | device->cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_buffer_size, NULL); | ||||
| if (DebugFlags().opencl.mem_limit) { | if (DeviceDebugFlags().opencl.mem_limit) { | ||||
| max_buffer_size = min(max_buffer_size, | max_buffer_size = min(max_buffer_size, | ||||
| cl_ulong(DebugFlags().opencl.mem_limit - device->stats.mem_used)); | cl_ulong(DeviceDebugFlags().opencl.mem_limit - device->stats.mem_used)); | ||||
| } | } | ||||
| VLOG(1) << "Maximum device allocation size: " << string_human_readable_number(max_buffer_size) | VLOG(1) << "Maximum device allocation size: " << string_human_readable_number(max_buffer_size) | ||||
| Context not available. | |||||
| cl_ulong max_alloc_size = 0; | cl_ulong max_alloc_size = 0; | ||||
| clGetDeviceInfo(cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_alloc_size, NULL); | clGetDeviceInfo(cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &max_alloc_size, NULL); | ||||
| if (DebugFlags().opencl.mem_limit) { | if (DeviceDebugFlags().opencl.mem_limit) { | ||||
| max_alloc_size = min(max_alloc_size, cl_ulong(DebugFlags().opencl.mem_limit - stats.mem_used)); | max_alloc_size = min(max_alloc_size, cl_ulong(DeviceDebugFlags().opencl.mem_limit - stats.mem_used)); | ||||
| } | } | ||||
| if (size > max_alloc_size) { | if (size > max_alloc_size) { | ||||
| Context not available. | |||||