OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

Intel Kernel Builder, Assigning Value to Buffers

ardiyu07
Beginner
319 Views
Hi.

I just downloaded Intel OpenCL SDK 2013 beta and tried using the new Kernel Builder.
My question is how do you assign value to a buffer using a .csv file? What is the format?
It's easy to assign an image because the format is in .bmp and is an image file, but how
do you put buffer's values to a .csv table?

Thanks.
0 Kudos
1 Solution
Oren_S_Intel1
Employee
319 Views
Hi,

The CSV file format is as follows:
Each line is one entry to the buffer. Inside each line, each column is a single element in the buffer's type, for example a float as part of a float4 entry.

So, for example, to represent a buffer of 2 float4 numbers your CSV can look like this:
0.1,0.2,0.3,0.4
1.1,1.2,1.3,1.4

Note that your CSV can have more columns and more lines than you'd use in your kernel, so you can create one CSV for multiple usages (float, float2, float3...float16) and with as many lines as you'd like, and when you create your kernel's argument limit its usage to your specific needs. For example, if you have 16 columns (for float16) and 1024 of such lines, but you need a float4 of 512 elements, you can use the same CSV, and your kernel will get the first 4 elements of each of the 512 lines only.


Oren Sarid

View solution in original post

0 Kudos
1 Reply
Oren_S_Intel1
Employee
320 Views
Hi,

The CSV file format is as follows:
Each line is one entry to the buffer. Inside each line, each column is a single element in the buffer's type, for example a float as part of a float4 entry.

So, for example, to represent a buffer of 2 float4 numbers your CSV can look like this:
0.1,0.2,0.3,0.4
1.1,1.2,1.3,1.4

Note that your CSV can have more columns and more lines than you'd use in your kernel, so you can create one CSV for multiple usages (float, float2, float3...float16) and with as many lines as you'd like, and when you create your kernel's argument limit its usage to your specific needs. For example, if you have 16 columns (for float16) and 1024 of such lines, but you need a float4 of 512 elements, you can use the same CSV, and your kernel will get the first 4 elements of each of the 512 lines only.


Oren Sarid
0 Kudos
Reply