jocl

how to know pixel color using t_sampler in jocl

血红的双手。 提交于 2020-01-25 12:59:04
问题 I want to detect peaks in a binary image using jocl. The definition of my peak is a combinition of colered pixels (shown in the image) how to use t_sampler to know pixel color? const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | //Natural coordinates CLK_ADDRESS_CLAMP | //Clamp to zeros CLK_FILTER_NEAREST; //Don't interpolate PS: my image is a binary image 来源: https://stackoverflow.com/questions/38340383/how-to-know-pixel-color-using-t-sampler-in-jocl

Using a barrier causes a CL_INVALID_WORK_GROUP_SIZE error

痴心易碎 提交于 2020-01-06 19:50:13
问题 If I use a barrier (no matter if CLK_LOCAL_MEM_FENCE or CLK_GLOBAL_MEM_FENCE ) in my kernel, it causes a CL_INVALID_WORK_GROUP_SIZE error. The global work size is 512, the local work size is 128, 65536 items have to be computed, the max work group size of my device is 1024, I am using only one dimension. For Java bindings I use JOCL. The kernel is very simple: kernel void sum(global float *input, global float *output, const int numElements, local float *localCopy { localCopy[get_local_id(0)]

OpenCL Shared Memory Among Tasks

牧云@^-^@ 提交于 2019-12-13 02:25:33
问题 I've been working to create a GPU based conway's game of life program. If you're not familiar with it, here is the Wikipedia Page. I created one version that works by keeping an array of values where 0 represents a dead cell, and 1 a live one. The kernel then simply writes to an image buffer data array to draw an image based on the cell data and then checks each cell's neighbors to update the cell array for the next execution to render. However, a faster method instead represents the value of

Releasing Memory Allocated by Native Libraries in Java

喜夏-厌秋 提交于 2019-11-30 14:42:24
If you are running code that makes calls to a native library in Java, what is the usual way of freeing memory allocated by these libraries when the memory allocation should last for the lifetime of the object? In C++, I would use destructors, but Java never really had those and has them even less now . The specific case I'm most interested in is JOCL , where I have an object that wraps a compiled OpenCL kernel and all of the arguments thereto that are always the same. Structures representing the compiled kernel and the arguments are all allocated on the library side, and JOCL provides a method

Releasing Memory Allocated by Native Libraries in Java

 ̄綄美尐妖づ 提交于 2019-11-29 21:24:28
问题 If you are running code that makes calls to a native library in Java, what is the usual way of freeing memory allocated by these libraries when the memory allocation should last for the lifetime of the object? In C++, I would use destructors, but Java never really had those and has them even less now. The specific case I'm most interested in is JOCL, where I have an object that wraps a compiled OpenCL kernel and all of the arguments thereto that are always the same. Structures representing