Kernel code documentation

21 views
Skip to first unread message

Scott Richmond

unread,
Jan 19, 2013, 10:44:56 AM1/19/13
to reaction-...@googlegroups.com
Hey,

Another post. :)

Struggling to find some kick starting documentation around writing OpenCL kernel code for Ready. I understand that kernel coding is agnostic to Ready. But I can't seem to find the option to create a new kernel pattern, as opposed to a formula pattern.

Tim Hutton

unread,
Jan 19, 2013, 3:30:07 PM1/19/13
to reaction-...@googlegroups.com
At the moment there are two ways to make a kernel rule:

1) Start from an existing kernel rule file (like kernel_test.vti or tri_life.vtu). Edit the kernel as desired.

2) Start with a formula rule file (either load one or use File > New Pattern...) then use Action > Convert to Full Kernel.

We probably need more documentation about how to write kernels.
--
Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/

Scott Richmond

unread,
Jan 19, 2013, 9:38:38 PM1/19/13
to reaction-...@googlegroups.com
Great I'll have a go at it.
Are you able to help me understand what the step() function is in the following formula:
delta_a = laplacian_a * step(-0.01f,-b);

I did about an hour of googling on it and couldn't find anything. :/

Tim Hutton

unread,
Jan 20, 2013, 8:04:43 AM1/20/13
to reaction-...@googlegroups.com

That's an OpenCL function. See the quick ref chart.

Robert Munafo

unread,
Jan 20, 2013, 11:25:15 AM1/20/13
to reaction-...@googlegroups.com
I don't know if Tim had a link in that reply, but here's a link:

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/commonFunctions.html

and better yet, the actual information (imagine that!)

gentype step ( gentype edge,
gentype x)

Built-in common functions operate component-wise and the description
is per-component. We use the generic type name gentype to indicate
that the function can take float, float2, float4, float8, or float16
as the type for the arguments.

The built-in common functions are implemented using the round to
nearest even rounding mode.

If extended with cl_khr_fp64, generic type name gentype may indicate
double and double{2|4|8|16} as arguments and return values. If
extended with cl_khr_fp16, generic type name gentype may indicate half
and half{2|4|8|16} as arguments and return values.

(from http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/step.html)

On 1/20/13, Tim Hutton <tim.h...@gmail.com> wrote:
> That's an OpenCL function. See the quick ref chart.

--
Robert Munafo -- mrob.com
Follow me at: gplus.to/mrob - fb.com/mrob27 - twitter.com/mrob_27 -
mrob27.wordpress.com - youtube.com/user/mrob143 - rilybot.blogspot.com
Reply all
Reply to author
Forward
0 new messages