35 lines
913 B
C
35 lines
913 B
C
#ifndef SETUP_H__
|
|
#define SETUP_H__
|
|
|
|
#define CL_TARGET_OPENCL_VERSION 220 /* For Sinaia cluster */
|
|
|
|
#include <CL/cl.h>
|
|
|
|
/*
|
|
* OpenCL user context.
|
|
*/
|
|
struct cl_uctx {
|
|
cl_context ctx; /* internal context */
|
|
cl_device_id *devices; /* device in use */
|
|
|
|
cl_command_queue gpu_queue; /* command queue */
|
|
cl_command_queue cpu_queue; /* command queue */
|
|
|
|
cl_device_type device_type; /* desired device type */
|
|
char platform_name[100]; /* desired platform */
|
|
|
|
size_t reduce_gws, reduce_lws; /* norm global and local workspace */
|
|
|
|
/* BLAS kernels */
|
|
cl_kernel gemm_NN_kernel, gemm_TN_kernel;
|
|
cl_kernel frob_stage1_kernel, frob_stage2_kernel;
|
|
};
|
|
|
|
cl_int cl_init(struct cl_uctx *uctx);
|
|
void cl_clean_up(struct cl_uctx uctx);
|
|
|
|
cl_int cl_build(struct cl_uctx uctx, cl_device_type dev, char *kern_name,
|
|
cl_program *pprogram);
|
|
cl_int cl_get_kern(cl_program program, char *kname, cl_kernel *pkern);
|
|
|
|
#endif
|