36 #include <OpenCL/cl.h>
47 #include "schwarz_kernel.cl.h"
50 void *arr2,
int * l2,
real * f2,
51 int * nx,
int * nel) {
57 const size_t global_item_size = 256 * (*nel);
58 const size_t local_item_size = 256;
65 cl_kernel kernel = clCreateKernel(schwarz_program, \
66 STR(schwarz_extrude_kernel_nx##NX), \
70 CL_CHECK(clSetKernelArg(kernel, 0, sizeof(cl_mem), (void *) &arr1)); \
71 CL_CHECK(clSetKernelArg(kernel, 1, sizeof(int), l1)); \
72 CL_CHECK(clSetKernelArg(kernel, 2, sizeof(real), f1)); \
73 CL_CHECK(clSetKernelArg(kernel, 3, sizeof(cl_mem), (void *) &arr2)); \
74 CL_CHECK(clSetKernelArg(kernel, 4, sizeof(int), l2)); \
75 CL_CHECK(clSetKernelArg(kernel, 5, sizeof(real), f2)); \
77 CL_CHECK(clEnqueueNDRangeKernel((cl_command_queue) glb_cmd_queue, \
78 kernel, 1, NULL, &global_item_size, \
79 &local_item_size, 0, NULL, NULL)); \
109 "schwarz_toext3d_kernel", &err);
112 CL_CHECK(clSetKernelArg(kernel, 0,
sizeof(cl_mem), (
void *) &a));
113 CL_CHECK(clSetKernelArg(kernel, 1,
sizeof(cl_mem), (
void *) &b));
114 CL_CHECK(clSetKernelArg(kernel, 2,
sizeof(
int), nx));
116 const size_t global_item_size = 256 * (*nel);
117 const size_t local_item_size = 256;
120 NULL, &global_item_size, &local_item_size,
131 "schwarz_toreg3d_kernel", &err);
134 CL_CHECK(clSetKernelArg(kernel, 0,
sizeof(cl_mem), (
void *) &b));
135 CL_CHECK(clSetKernelArg(kernel, 1,
sizeof(cl_mem), (
void *) &a));
136 CL_CHECK(clSetKernelArg(kernel, 2,
sizeof(
int), nx));
138 const size_t global_item_size = 256 * (*nel);
139 const size_t local_item_size = 256;
142 NULL, &global_item_size, &local_item_size,
void opencl_kernel_jit(const char *kernel, cl_program *program)
void opencl_schwarz_toreg3d(void *b, void *a, int *nx, int *nel)
void opencl_schwarz_toext3d(void *a, void *b, int *nx, int *nel)
void opencl_schwarz_extrude(void *arr1, int *l1, real *f1, void *arr2, int *l2, real *f2, int *nx, int *nel)