/* Track allocations and report current number of unfreed allocations */
extern CL_API_ENTRY cl_int CL_API_CALL
-clIntelReportUnfreed(void);
+clReportUnfreedIntel(void);
/* 1 to 1 mapping of drm_intel_bo_map */
extern CL_API_ENTRY void* CL_API_CALL
-clIntelMapBuffer(cl_mem, cl_int*);
+clMapBufferIntel(cl_mem, cl_int*);
/* 1 to 1 mapping of drm_intel_bo_unmap */
extern CL_API_ENTRY cl_int CL_API_CALL
-clIntelUnmapBuffer(cl_mem);
+clUnmapBufferIntel(cl_mem);
/* 1 to 1 mapping of drm_intel_gem_bo_map_gtt */
extern CL_API_ENTRY void* CL_API_CALL
-clIntelMapBufferGTT(cl_mem, cl_int*);
+clMapBufferGTTIntel(cl_mem, cl_int*);
/* 1 to 1 mapping of drm_intel_gem_bo_unmap_gtt */
extern CL_API_ENTRY cl_int CL_API_CALL
-clIntelUnmapBufferGTT(cl_mem);
+clUnmapBufferGTTIntel(cl_mem);
/* Pin /Unpin the buffer in GPU memory (must be root) */
extern CL_API_ENTRY cl_int CL_API_CALL
-clIntelPinBuffer(cl_mem);
+clPinBufferIntel(cl_mem);
extern CL_API_ENTRY cl_int CL_API_CALL
-clIntelUnpinBuffer(cl_mem);
+clUnpinBufferIntel(cl_mem);
/* Get the generation of the Gen device (used to load the proper binary) */
extern CL_API_ENTRY cl_int CL_API_CALL
-clIntelGetGenVersion(cl_device_id device, cl_int *ver);
+clGetGenVersionIntel(cl_device_id device, cl_int *ver);
/* Create a program from a LLVM source file */
extern CL_API_ENTRY cl_program CL_API_CALL
-clCreateProgramWithLLVM(cl_context /* context */,
- cl_uint /* num_devices */,
- const cl_device_id * /* device_list */,
- const char * /* file */,
- cl_int * /* errcode_ret */);
+clCreateProgramWithLLVMIntel(cl_context /* context */,
+ cl_uint /* num_devices */,
+ const cl_device_id * /* device_list */,
+ const char * /* file */,
+ cl_int * /* errcode_ret */);
#ifdef __cplusplus
}
cl_int err = CL_SUCCESS;
assert(ptr != NULL);
void* temp_ptr = NULL;
- temp_ptr = clIntelMapBuffer(buffer, &err);
+ temp_ptr = clMapBufferIntel(buffer, &err);
assert(err == CL_SUCCESS);
memcpy(ptr, temp_ptr, cb);
return err;
if (blocking_write != CL_TRUE)
NOT_IMPLEMENTED;
cl_int err;
- void *p = clIntelMapBuffer(buffer, &err);
+ void *p = clMapBufferIntel(buffer, &err);
if (err != CL_SUCCESS)
return err;
memcpy(p + offset, ptr, cb);
- err = clIntelUnmapBuffer(buffer);
+ err = clUnmapBufferIntel(buffer);
return err;
}
NOT_IMPLEMENTED;
if (offset != 0)
NOT_IMPLEMENTED;
- p = clIntelMapBuffer(buffer, errcode_ret);
+ p = clMapBufferIntel(buffer, errcode_ret);
return p;
}
const cl_event * event_wait_list,
cl_event * event)
{
- return clIntelUnmapBuffer(memobj);
+ return clUnmapBufferIntel(memobj);
}
cl_int
}
cl_int
-clIntelReportUnfreed(void)
+clReportUnfreedIntel(void)
{
return cl_report_unfreed();
}
void*
-clIntelMapBuffer(cl_mem mem, cl_int *errcode_ret)
+clMapBufferIntel(cl_mem mem, cl_int *errcode_ret)
{
void *ptr = NULL;
cl_int err = CL_SUCCESS;
}
cl_int
-clIntelUnmapBuffer(cl_mem mem)
+clUnmapBufferIntel(cl_mem mem)
{
cl_int err = CL_SUCCESS;
CHECK_MEM (mem);
}
void*
-clIntelMapBufferGTT(cl_mem mem, cl_int *errcode_ret)
+clMapBufferGTTIntel(cl_mem mem, cl_int *errcode_ret)
{
void *ptr = NULL;
cl_int err = CL_SUCCESS;
}
cl_int
-clIntelUnmapBufferGTT(cl_mem mem)
+clUnmapBufferGTTIntel(cl_mem mem)
{
cl_int err = CL_SUCCESS;
CHECK_MEM (mem);
}
cl_int
-clIntelPinBuffer(cl_mem mem)
+clPinBufferIntel(cl_mem mem)
{
cl_int err = CL_SUCCESS;
CHECK_MEM (mem);
}
cl_int
-clIntelUnpinBuffer(cl_mem mem)
+clUnpinBufferIntel(cl_mem mem)
{
cl_int err = CL_SUCCESS;
CHECK_MEM (mem);
}
cl_int
-clIntelGetGenVersion(cl_device_id device, cl_int *ver)
+clGetGenVersionIntel(cl_device_id device, cl_int *ver)
{
return cl_device_get_version(device, ver);
}
cl_program
-clCreateProgramWithLLVM(cl_context context,
- cl_uint num_devices,
- const cl_device_id * devices,
- const char * filename,
- cl_int * errcode_ret)
+clCreateProgramWithLLVMIntel(cl_context context,
+ cl_uint num_devices,
+ const cl_device_id * devices,
+ const char * filename,
+ cl_int * errcode_ret)
{
return cl_program_create_from_llvm(context,
num_devices,
NULL);
// Be sure that everything run fine
- dst_buffer = (int *) clIntelMapBuffer(dst[j], &status);
+ dst_buffer = (int *) clMapBufferIntel(dst[j], &status);
if (status != CL_SUCCESS)
goto error;
for (uint32_t i = 0; i < n; ++i)
fprintf(stderr, "run-time flat address space failed\n");
exit(-1);
}
- OCL_CALL (clIntelUnmapBuffer, dst[j]);
+ OCL_CALL (clUnmapBufferIntel, dst[j]);
}
for (uint32_t j = 0; j < 24; ++j) OCL_CALL (clReleaseMemObject, dst[j]);
cl_test_destroy();
- printf("%i memory leaks\n", clIntelReportUnfreed());
- assert(clIntelReportUnfreed() == 0);
+ printf("%i memory leaks\n", clReportUnfreedIntel());
+ assert(clReportUnfreedIntel() == 0);
error:
return status;
if (device == NULL)
sub_path = "";
else {
- if (clIntelGetGenVersion(device, &ver) != CL_SUCCESS)
+ if (clGetGenVersionIntel(device, &ver) != CL_SUCCESS)
clpanic("Unable to get Gen version", -1);
sub_path = "";
}
/* Load the program and build it */
ker_path = do_kiss_path(file_name, device);
if (format == LLVM)
- program = clCreateProgramWithLLVM(ctx, 1, &device, ker_path, &status);
+ program = clCreateProgramWithLLVMIntel(ctx, 1, &device, ker_path, &status);
else if (format == SOURCE) {
cl_file_map_t *fm = cl_file_map_new();
FATAL_IF (cl_file_map_open(fm, ker_path) != CL_FILE_MAP_SUCCESS,
{
cl_kernel_destroy();
cl_ocl_destroy();
- printf("%i memory leaks\n", clIntelReportUnfreed());
- assert(clIntelReportUnfreed() == 0);
+ printf("%i memory leaks\n", clReportUnfreedIntel());
+ assert(clReportUnfreedIntel() == 0);
}
void
int i;
for (i = 0; i < MAX_BUFFER_N; ++i) {
if (buf_data[i] != NULL) {
- clIntelUnmapBuffer(buf[i]);
+ clUnmapBufferIntel(buf[i]);
buf_data[i] = NULL;
}
if (buf[i] != NULL) {
uint32_t i;
if (perf == NULL)
return;
- start = (uint32_t*) clIntelMapBuffer(perf, &status);
+ start = (uint32_t*) clMapBufferIntel(perf, &status);
assert(status == CL_SUCCESS && start != NULL);
end = start + 128;
}
printf("\n\n");
- clIntelUnmapBuffer(perf);
+ clUnmapBufferIntel(perf);
}
struct bmphdr {
OCL_CALL2(clCreateSampler, SAMPLER, ctx, 0, ADDRESS_MODE, FILTER_MODE)
#define OCL_MAP_BUFFER(ID) \
- OCL_CALL2(clIntelMapBuffer, buf_data[ID], buf[ID])
+ OCL_CALL2(clMapBufferIntel, buf_data[ID], buf[ID])
#define OCL_UNMAP_BUFFER(ID) \
do { \
if (buf[ID] != NULL) { \
- OCL_CALL (clIntelUnmapBuffer, buf[ID]); \
+ OCL_CALL (clUnmapBufferIntel, buf[ID]); \
buf_data[ID] = NULL; \
} \
} while (0)