- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am pretty much new to OpenCL.
I wantto read a jpeg image file into the kernel, do some processing, get the results back to the host and output the image file into some other location. I am facing somedifficulties doing this.
When using the clCreateImage2D,I need to specify the size of the image manually. Is there a way that I can get the size of the image from some routines and pass them tothis function.?
AlsoI need to understandwhatthe "host ptr" arguement(last but second arguement) exactly meansthat theclCreateImage2D routinetakes. Isit like we can specify thelocation of the image directly ?
I am pretty much new to OpenCL.
I wantto read a jpeg image file into the kernel, do some processing, get the results back to the host and output the image file into some other location. I am facing somedifficulties doing this.
When using the clCreateImage2D,I need to specify the size of the image manually. Is there a way that I can get the size of the image from some routines and pass them tothis function.?
AlsoI need to understandwhatthe "host ptr" arguement(last but second arguement) exactly meansthat theclCreateImage2D routinetakes. Isit like we can specify thelocation of the image directly ?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The first part of your question is not really OpenCL related. There are many libraries available that let you read/write jpeg files that give you a way to get the image dimensions.
The host_ptr argument that clCreateImage2D() requires is the address in the host memory that points tothe image data.
Also, note that on CPU images are very slow. It is recommended to use buffers. You are fine on GPU.
Thanks,
Raghu
The host_ptr argument that clCreateImage2D() requires is the address in the host memory that points tothe image data.
Also, note that on CPU images are very slow. It is recommended to use buffers. You are fine on GPU.
Thanks,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Raghupati.
I found that I can directly use the C++ library routines to get the image dimensions and not depend on opencl for that. So now can I do this..
I will convert the jpeg image into some array and convert that to a float array. Can I create a buffer and put this float array into the buffer. Then do some processing on the GPU kernel.
I hope this should be fine. can the clEnqueueWriteBuffer() be used for this purpose?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page