Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Seiya Nishizawa
RE: Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2011-01-13 08:06
At this moment, gem for ruby-opencl does not exist.

I added the mentioning about installing narray to Release_Note.txt.


By: Ghassan A.
RE: Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2011-01-13 02:48
so any thoughts on the method require and NArray errors below please??

==================
LoadError: no such file to load — narray

method require in untitled document at line 29
method require in untitled document at line 29
method <top (required)> in opencl.rb at line 15
method require in untitled document at line 29
method require in untitled document at line 29
method <top (required)> in quick_opencl.rb at line 4
method require in untitled document at line 29
method require in untitled document at line 29
method <main> in product_vector_quick.rb at line 4
=======================

Best,
Gus.

By: Ghassan A.
RE: Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2011-01-12 19:50
Hi Seiya:

Thank you very much for the quick update. Now, I am running OSX 10.6.6 (latest) with ruby-1.9.2-p136. When I follow the instructions in the release notes, it builds with a list of warnings successully:

=====================

gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-darwin10.5.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_OPENCL_OPENCL_H -DCL_LITTLE_ENDIAN -I/usr/local/lib/ruby/1.9.1/x86_64-darwin10.5.0/include -I/path_to_directory_of_CL/opencl.h -I./include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o rb_opencl.o -c rb_opencl.c
rb_opencl.c: In function ‘rb_clBuildProgram’:
rb_opencl.c:422: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clCreateContext’:
rb_opencl.c:684: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:697: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clCreateContextFromType’:
rb_opencl.c:780: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clCreateProgramWithBinary’:
rb_opencl.c:1222: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clCreateProgramWithSource’:
rb_opencl.c:1301: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueCopyBuffer’:
rb_opencl.c:1574: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueCopyBufferToImage’:
rb_opencl.c:1920: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueCopyImage’:
rb_opencl.c:2076: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueCopyImageToBuffer’:
rb_opencl.c:2224: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueMapBuffer’:
rb_opencl.c:2345: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueMapImage’:
rb_opencl.c:2489: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueNDRangeKernel’:
rb_opencl.c:2641: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:2671: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueNativeKernel’:
rb_opencl.c:2776: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:2805: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueReadBuffer’:
rb_opencl.c:2913: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueReadImage’:
rb_opencl.c:3278: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueTask’:
rb_opencl.c:3386: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueUnmapMemObject’:
rb_opencl.c:3474: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueWaitForEvents’:
rb_opencl.c:3552: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueWriteBuffer’:
rb_opencl.c:3644: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clEnqueueWriteImage’:
rb_opencl.c:4025: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_clWaitForEvents’:
rb_opencl.c:5353: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_CreateVArrayFromObject’:
rb_opencl.c:7854: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:7857: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
rb_opencl.c:7858: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c: In function ‘rb_VArray_aref’:
rb_opencl.c:7986: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’
rb_opencl.c: In function ‘rb_VArray_aset’:
rb_opencl.c:8018: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’
rb_opencl.c:8040: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8050: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8061: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8072: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8083: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8097: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8107: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8118: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8129: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8140: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8154: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8164: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8175: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8186: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8197: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8211: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8221: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8232: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8243: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8254: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8268: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8278: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8289: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8300: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8311: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8325: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8335: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8346: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8357: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8368: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8382: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8392: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8403: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8414: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8425: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8439: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8449: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8460: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8471: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8482: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8496: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8506: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8517: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8528: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8539: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8553: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8563: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8574: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8585: warning: implicit conversion shortens 64-bit value into a 32-bit value
rb_opencl.c:8596: warning: implicit conversion shortens 64-bit value into a 32-bit value
gcc -dynamic -bundle -o opencl.bundle rb_opencl.o -L. -L/usr/local/lib -L/usr/local/lib/ruby/1.9.1/x86_64-darwin10.5.0/lib -L./lib -framework OpenCL -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lruby.1.9.1 -lpthread -ldl -lobjc
ld: warning: directory '/usr/local/lib/ruby/1.9.1/x86_64-darwin10.5.0/lib' following -L not found
[/usr/local/ruby-opencl-0.91] >make install
/usr/bin/install -c -m 0755 opencl.bundle /usr/local/lib/ruby/site_ruby/1.9.1/x86_64-darwin10.5.0
==================

I noticed that:

(1) there are no gem files produced. Am I right?
(2) when I proceed to run the samples, for example: product_vector_quick.rb, I get the following warnings (under 1.9.2-p136) and error:


Running “product_vector_quick.rb”…
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]

/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:93: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:167: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:170: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:173: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:176: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:179: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:185: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:219: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:222: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:250: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:253: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:256: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:262: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:292: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:295: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:332: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:367: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:370: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:373: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:445: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:448: warning: `*' interpreted as argument prefix
/usr/local/lib/ruby/site_ruby/1.9.1/opencl.rb:451: warning: `*' interpreted as argument prefix
LoadError: no such file to load — narray

method require in untitled document at line 29
method require in untitled document at line 29
method <top (required)> in opencl.rb at line 15
method require in untitled document at line 29
method require in untitled document at line 29
method <top (required)> in quick_opencl.rb at line 4
method require in untitled document at line 29
method require in untitled document at line 29
method <main> in product_vector_quick.rb at line 4

============

now it is worth mentioning that there is no NArray under 1.9.2 as this was merged I suppose with Array. The require might be looking for the gem or file "quick_opencl".

Any ideas? Thanks very much indeed.

Best,
Ghassan.

By: Seiya Nishizawa
RE: Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2011-01-12 03:07
Hi Ghassan,

I had forgotten to commit my modification to repository, and released to 0.9 with not-updated files.

I updated and released 0.91.

Thanks to your report.

Seiya

By: Ghassan A.
RE: Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2011-01-12 02:09
I have downloaded the latest 0.9 ruby-opencl and I get the same error:

==================
rb_opencl.c:12317: error: (Each undeclared identifier is reported only once
rb_opencl.c:12317: error: for each function it appears in.)
rb_opencl.c:12320: error: ‘rb_clEnqueueCopyBufferRect’ undeclared (first use in this function)
rb_opencl.c:12330: error: ‘rb_clEnqueueReadBufferRect’ undeclared (first use in this function)
rb_opencl.c:12336: error: ‘rb_clEnqueueWriteBufferRect’ undeclared (first use in this function)
rb_opencl.c:12356: error: ‘rb_clSetEventCallback’ undeclared (first use in this function)
rb_opencl.c:12358: error: ‘rb_clSetUserEventStatus’ undeclared (first use in this function)
make: *** [rb_opencl.o] Error 1
===================

now i am using Snow Leopard 10.6.6 latest updates. I would assume this has the latest OpenCL 1.1 on it.

your help is warmly appreciated. Thanks.

Gus.

By: Seiya Nishizawa
RE: Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2010-12-02 07:29
Hi Kurt,

Thanks to your report.
I fixed them and released ruby-opencl-0.9.

By: Kurt Landrus
Init_opencl needs IF_DEFS on 1.1 methods [ reply ]  
2010-12-02 03:21
I needed to add the 1.1 method declarations IF_DEF'd to get rb_opencl.c to compile on Mac OS X (which I guess does not yet support 1.1.
1.1 method definitions need to be IF_DEF'd in Init_opencl

#ifdef CL_VERSION_1_1
rb_define_method(rb_cMem, "create_sub_buffer", rb_clCreateSubBuffer, -1);
rb_define_method(rb_cCommandQueue, "enqueue_copy_buffer_rect", rb_clEnqueueCopyBufferRect, -1);
rb_define_method(rb_cCommandQueue, "enqueue_read_buffer_rect", rb_clEnqueueReadBufferRect, -1);
rb_define_method(rb_cCommandQueue, "enqueue_write_buffer_rect", rb_clEnqueueWriteBufferRect, -1);
rb_define_method(rb_cEvent, "set_callback", rb_clSetEventCallback, -1);
rb_define_method(rb_cEvent, "set_user_event_status", rb_clSetUserEventStatus, -1);
#endif