36 #include <OpenCL/cl.h>
47 #include "symmetry_kernel.cl.h"
49 #define MAX(a, b) (a > b ? a : b)
55 void *
x,
void *y,
void *z,
56 int *m,
int *n,
int *l) {
64 "symmetry_apply_vector_kernel", &err);
67 CL_CHECK(clSetKernelArg(kernel, 0,
sizeof(cl_mem), (
void *) &xmsk));
68 CL_CHECK(clSetKernelArg(kernel, 1,
sizeof(cl_mem), (
void *) &ymsk));
69 CL_CHECK(clSetKernelArg(kernel, 2,
sizeof(cl_mem), (
void *) &zmsk));
70 CL_CHECK(clSetKernelArg(kernel, 3,
sizeof(cl_mem), (
void *) &
x));
71 CL_CHECK(clSetKernelArg(kernel, 4,
sizeof(cl_mem), (
void *) &y));
72 CL_CHECK(clSetKernelArg(kernel, 5,
sizeof(cl_mem), (
void *) &z));
73 CL_CHECK(clSetKernelArg(kernel, 6,
sizeof(
int), m));
74 CL_CHECK(clSetKernelArg(kernel, 7,
sizeof(
int), n));
75 CL_CHECK(clSetKernelArg(kernel, 8,
sizeof(
int), l));
77 const int max_len =
MAX(
MAX(*m, *n), *l);
78 const int nb = (max_len + 256 - 1) / 256;
79 const size_t global_item_size = 256 * nb;
80 const size_t local_item_size = 256;
83 NULL, &global_item_size, &local_item_size,
__global__ void const T *__restrict__ x
void opencl_kernel_jit(const char *kernel, cl_program *program)
void opencl_symmetry_apply_vector(void *xmsk, void *ymsk, void *zmsk, void *x, void *y, void *z, int *m, int *n, int *l)