Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4854 > unrolled thread

Simple OpenCL program in Mathematica

Started byAnna Ceguerra <anna.ceguerra@sydney.edu.au>
First post2011-09-10 11:29 +0000
Last post2011-09-10 11:29 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Simple OpenCL program in Mathematica Anna Ceguerra <anna.ceguerra@sydney.edu.au> - 2011-09-10 11:29 +0000

#4854 — Simple OpenCL program in Mathematica

FromAnna Ceguerra <anna.ceguerra@sydney.edu.au>
Date2011-09-10 11:29 +0000
SubjectSimple OpenCL program in Mathematica
Message-ID<j4fhm2$2e2$1@smc.vnet.net>
Hi,

This program that I'm trying in notebook doesn't work, but the documentation
doesn't say how to fix it (what is a valid argtype for string?):

Needs["OpenCLLink`"]

src2 = "
  __kernel void hello(__global char * arry, mint len) {

    size_t index = get_global_id(0);
    

    if (index >= len) return;
        

    arry[index] = index + '0';

  }
  ";

helloWorld = OpenCLFunctionLoad[src2, "hello", {{_Character}, _Integer},
16];

helloWorld["0000000000", 10]

Error message:
OpenCLFunctionLoad::invtypspec: "{_Character} is not a valid argument type."

I would like to be able to set the ASCII characters in the char * array in
OpenCL, and print the result to the notebook in Mathematica. I tried several
things, including changing _Character to _String, and changing all strings
to integer array.

What do I need to be able to get this to work? If you need further details
on what I'm trying to do, please let me know.

Thanks and regards,
Anna.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web