tmd_opencl/tmh_ocl.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <CL/cl.h>
Go to the source code of this file.
Classes |
struct | tmt_ocl_device_struct |
struct | tmt_ocl_platform_struct |
struct | tmt_ocl_struct |
Defines |
#define | TMC_OCL_ALL_PLATFORMS -1 |
#define | TMC_OCL_ALL_DEVICES -1 |
#define | TMC_OCL_DEVICE_CPU 0 |
#define | TMC_OCL_DEVICE_GPU 1 |
#define | TMC_OCL_DEVICE_ACCELERATOR 2 |
#define | TMC_OCL_MAX_NUM_KERNELS 10 |
#define | TMC_OCL_KERNEL_NUM_INT_INDEX 0 |
#define | TMC_OCL_KERNEL_CRS_FINALIZE 1 |
#define | TMC_OCL_KERNEL_SOLVE 2 |
#define | TMC_OCL_KERNEL_REWRITE_GEO 3 |
Functions |
int | tmr_ocl_init (char *Work_dir, FILE *Interactive_input, FILE *Interactive_output, int Control, int Monitor) |
int | tmr_ocl_create_contexts (FILE *Interactive_output, int Chosen_platform_id, int Monitor) |
int | tmr_ocl_create_command_queues (FILE *Interactive_output, int Chosen_platform_index, int Chosen_device_type, int Monitor) |
int | tmr_ocl_create_kernel (FILE *Interactive_output, int Platform_index, int Device_index, int Kernel_index, char *Kernel_name, const char *FileName, int Monitor) |
char * | tmr_ocl_readSource (FILE *Interactive_output, const char *kernelPath) |
int | tmr_ocl_get_current_platform_index () |
int | tmr_ocl_get_current_device_type () |
int | tmr_ocl_get_current_device () |
int | tmr_ocl_select_device (FILE *Interactive_output, int Platform_index, int Device_tmc_type) |
int | tmr_ocl_device_type (int Platform_index, int Device_index) |
cl_device_id | tmr_ocl_select_device_id (int Platform_index, int Device_index) |
cl_context | tmr_ocl_select_context (int Platform_index, int Device_index) |
cl_command_queue | tmr_ocl_select_command_queue (int Platform_index, int Device_index) |
cl_kernel | tmr_ocl_select_kernel (int Platform_index, int Device_index, int Kernel_index) |
void | tmr_ocl_cleanup () |
void | tmr_kernel_execution_log (cl_int error_code, int line_code, const char *function_name) |
void | tmr_set_kernel_arguments_log (cl_int error_code, int argument_index, int line_code, const char *function_name) |
Variables |
tmt_ocl_struct | tmv_ocl_struct |
Define Documentation
#define TMC_OCL_ALL_DEVICES -1 |
#define TMC_OCL_ALL_PLATFORMS -1 |
#define TMC_OCL_DEVICE_ACCELERATOR 2 |
#define TMC_OCL_DEVICE_CPU 0 |
#define TMC_OCL_DEVICE_GPU 1 |
#define TMC_OCL_KERNEL_CRS_FINALIZE 1 |
#define TMC_OCL_KERNEL_NUM_INT_INDEX 0 |
#define TMC_OCL_KERNEL_REWRITE_GEO 3 |
#define TMC_OCL_KERNEL_SOLVE 2 |
#define TMC_OCL_MAX_NUM_KERNELS 10 |
Function Documentation
void tmr_kernel_execution_log |
( |
cl_int |
error_code, |
|
|
int |
line_code, |
|
|
const char * |
function_name | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_cleanup - discards created OpenCL resources ---------------------------------------------------------
int tmr_ocl_create_command_queues |
( |
FILE * |
Interactive_output, |
|
|
int |
Chosen_platform_index, |
|
|
int |
Chosen_device_type, |
|
|
int |
Monitor | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_create_command_queues - for a selected platform and device ---------------------------------------------------------
int tmr_ocl_create_contexts |
( |
FILE * |
Interactive_output, |
|
|
int |
Chosen_platform_id, |
|
|
int |
Monitor | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_create_contexts - to create OpenCL contexts on a selected platform ---------------------------------------------------------
int tmr_ocl_create_kernel |
( |
FILE * |
Interactive_output, |
|
|
int |
Platform_index, |
|
|
int |
Device_index, |
|
|
int |
Kernel_index, |
|
|
char * |
Kernel_name, |
|
|
const char * |
FileName, |
|
|
int |
Monitor | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_create_kernel - for a selected platform, device and kernel index ---------------------------------------------------------
int tmr_ocl_device_type |
( |
int |
Platform_index, |
|
|
int |
Device_index | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_device_type - returns LOCAL device type (INTEGER) ---------------------------------------------------------
int tmr_ocl_get_current_device |
( |
|
) |
|
-------------------------------------------------------- tmr_ocl_get_current_device() - to return the index of current OpenCL device (selected based on compiler switches) ---------------------------------------------------------
int tmr_ocl_get_current_device_type |
( |
|
) |
|
-------------------------------------------------------- tmr_ocl_get_current_device_type() - to return the type of current OpenCL device (selected based on compiler switches) ---------------------------------------------------------
int tmr_ocl_get_current_platform_index |
( |
|
) |
|
-------------------------------------------------------- tmr_ocl_get_current_platform_index() - to return the index of current OpenCL platform ---------------------------------------------------------
int tmr_ocl_init |
( |
char * |
Work_dir, |
|
|
FILE * |
Interactive_input, |
|
|
FILE * |
Interactive_output, |
|
|
int |
Control, |
|
|
int |
Monitor | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_init - to initialize OpenCL thread management ---------------------------------------------------------
char* tmr_ocl_readSource |
( |
FILE * |
Interactive_output, |
|
|
const char * |
kernelPath | |
|
) |
| | |
cl_command_queue tmr_ocl_select_command_queue |
( |
int |
Platform_index, |
|
|
int |
Device_index | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_select_command_queue - selects command queue for a given device ---------------------------------------------------------
cl_context tmr_ocl_select_context |
( |
int |
Platform_index, |
|
|
int |
Device_index | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_select_context - selects context for a given device ---------------------------------------------------------
int tmr_ocl_select_device |
( |
FILE * |
Interactive_output, |
|
|
int |
Platform_index, |
|
|
int |
Device_tmc_type | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_select_device returns OpenCL device index (for local data structures) or -1 if device is not available (not existing or not serviced) for the specified platform ---------------------------------------------------------
cl_device_id tmr_ocl_select_device_id |
( |
int |
Platform_index, |
|
|
int |
Device_index | |
|
) |
| | |
--------------------------------------------------------- tmr_ocl_select_device_id - selects command queue for a given device ---------------------------------------------------------
cl_kernel tmr_ocl_select_kernel |
( |
int |
Platform_index, |
|
|
int |
Device_index, |
|
|
int |
Kernel_index | |
|
) |
| | |
-------------------------------------------------------- tmr_ocl_select_kernel - selects kernel for a given device and kernel index ---------------------------------------------------------
void tmr_set_kernel_arguments_log |
( |
cl_int |
error_code, |
|
|
int |
argument_index, |
|
|
int |
line_code, |
|
|
const char * |
function_name | |
|
) |
| | |
Variable Documentation