1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #define NX 1024
- struct point array_of_structs[NX];
- starpu_data_handle_t handle;
- #ifdef STARPU_USE_OPENCL
- void cpu_to_opencl_opencl_func(void *buffers[], void *args);
- struct starpu_codelet cpu_to_opencl_cl = {
- .where = STARPU_OPENCL,
- .opencl_funcs = { cpu_to_opencl_opencl_func },
- .nbuffers = 1,
- .modes = { STARPU_RW }
- };
- void opencl_to_cpu_func(void *buffers[], void *args);
- struct starpu_codelet opencl_to_cpu_cl = {
- .where = STARPU_CPU,
- .cpu_funcs = { opencl_to_cpu_func },
- .cpu_funcs_name = { "opencl_to_cpu_func" },
- .nbuffers = 1,
- .modes = { STARPU_RW }
- };
- #endif
- struct starpu_multiformat_data_interface_ops format_ops = {
- #ifdef STARPU_USE_OPENCL
- .opencl_elemsize = 2 * sizeof(float),
- .cpu_to_opencl_cl = &cpu_to_opencl_cl,
- .opencl_to_cpu_cl = &opencl_to_cpu_cl,
- #endif
- .cpu_elemsize = 2 * sizeof(float),
- ...
- };
- starpu_multiformat_data_register(handle, STARPU_MAIN_RAM, &array_of_structs, NX, &format_ops);
|