]> gitweb.factorcode.org Git - factor.git/commitdiff
opencl: Make it compile at least. Throws error -38 on my linux box.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 22 Oct 2012 21:02:19 +0000 (14:02 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 22 Oct 2012 21:03:22 +0000 (14:03 -0700)
extra/opencl/ffi/ffi-tests.factor
extra/opencl/opencl-tests.factor
extra/opencl/opencl.factor

index 08d13062e1404d91dbb8f0f63cb77ef7cbcdb007..a1baf084ac54a93110eca7e6d603c5a16abff9f8 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2010 Erik Charlebois.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: tools.test opencl.ffi multiline locals kernel io.encodings.ascii
-io.encodings.string sequences libc alien.c-types destructors math specialized-arrays
-math.order alien ;
+io.encodings.string sequences libc alien.c-types destructors math
+specialized-arrays alien.data math.order alien ;
 FROM: alien.c-types => float ;
 SPECIALIZED-ARRAYS: float void* ;
 IN: opencl.ffi.tests
index 316d496ac881509b80d3c15e15ab04c2c43c831f..15eaf0646c8a3d04ae9cd8247a0b54343c96aa01 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: multiline locals io.encodings.ascii io.encodings.string sequences
 math specialized-arrays alien.c-types math.order alien opencl tools.test
-accessors arrays destructors kernel namespaces ;
+accessors arrays destructors kernel namespaces alien.data ;
 FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: opencl.tests
@@ -31,13 +31,14 @@ __kernel void square(
             "" kernel-source 1array <cl-program> &dispose "square" <cl-kernel> &dispose :> kernel
             cl-read-access num-bytes in <cl-buffer> &dispose :> in-buffer
             cl-write-access num-bytes f <cl-buffer> &dispose :> out-buffer
-            
+           
             kernel in-buffer out-buffer num-floats uint <ref> 3array
             { num-floats } [ ] cl-queue-kernel &dispose drop
             
             cl-finish
+
             out-buffer 0 num-bytes <cl-buffer-range>
-            cl-read-buffer num-floats flloat <c-direct-array>
+            cl-read-buffer num-floats \ float <c-direct-array>
         ] with-cl-state
     ] with-destructors ;
 
index e1c105959d44d79ef509ec2a3d538cd48d082316..1641579402afbef84c931e3fa73dd23895d3cd8b 100644 (file)
@@ -424,7 +424,7 @@ PRIVATE>
             [ cl-current-device  ,, ] when*
             [ cl-current-context ,, ] when*
         ] 3curry H{ } make
-    ] dip with-variable ; inline
+    ] dip with-variables ; inline
 
 : cl-platforms ( -- platforms )
     0 f 0 uint <ref> [ clGetPlatformIDs cl-success ] keep uint deref