![]() ![]() Alternatively you can get it directly from This is no longer a default install since Mac OS X 10.8, but the OS should offer to it install it for you if something tries to use it. On Mac OS X you must have a copy of XQuartz, the X11 window manager, installed. The only pre-requisite for most functionality is a recent version of R (>=3.1.0 recommended).ģD visualisation is provided by the rgl package based on OpenGL. Nat is an R package and therefore runs on Mac/Linux/Windows. # make a legend so that you know which colours match which glomerulus with( attr(rval, 'df'), legend( 'center', legend = unique(Glomerulus), fill= unique(col))) Rval= plot3d(MyNeurons, subset= grepl( "^DM",Glomerulus), col= factor(Glomerulus), # 3d plot of neurons from olfactory glomeruli beginning DM # coloured by glomerulus # plot some test data (?kcs20 for details) # Drosophila Kenyon cells processed from raw data at head(kcs20)Ī larger data set, 300 olfactory projection neurons from Grosjean et al 2011: load( url( "")) Nat is a cleaned up version of code that has been used in a number of papers from our group including:įor the impatient. See nat.examples and frulhns for sample code. Specialized for OpenCL) then JIT compile it and run it on the GPU.An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons. The GPU, internally it would compile the block as LLVM IR (probably Would be awesome if in MacRuby you could just send a given block to So LLVM should be able to generate code for OpenCL, I believe. I tried twice creating a very simple compiler with LLVM bitcode”, but I’m definitely not qualified to even consider I even saw Laurent talk about a “Ruby -> OpenCL direct compiler via Would be interesting to have a look at it to see how they do things :) This is the method we are taking for GCD.Īlso, I heard there is an existing OpenCL wrapper for MRI, maybe it I will have a better look when I have some time, but may I suggest theġ) Try to wrap as much as the OpenCL API as possible in this C module.Ģ) Write higher-level APIs/paradigms in a pure Ruby file that would To write in Ruby would be very very welcome. Any suggestion on how to make this more pleasant ThereĪre all sorts of variations on each call, and a number of differentĮntities (classes). OpenCL seems like a huge API, and Iĭon’t have a really background knowledge of GPU programming. How to turn the OpenCL API more “Rubyish" ![]() xfree() is theĪppropriate free method, but you don't need to call it. When using xmalloc(), free() should not be used. Is automatically GC’ed :) Can you clear this for me and show me the However, when I called “free” after I don’t need the memory anymore,Īll sorts of warnings happened at runtime.Īfter I deleted the “free” calls, it all worked, but I’m not sure “xmalloc” (discovered by looking at other macurby *.c files). The extension, I needed to do a couple of memory allocations. The work already started a little bit.Īs I said, I never wrote a MacRuby extension before. However, in the next release (0.6) we intend to fully support the But I believe you should not need to do this. Source code for "rb_objc_install_method2" calls using the "finalize"ģ) If you decide to store inside the RData structure a C structureĪllocated with Ruby allocated memory (xmallos & friend), you must beĬareful to appropriately use write barriers when setting Ruby objects Implement a -finalize method on the class. In order to free resources upon GC cycles, one must For this, you are using the followingġ) The mark callback will not be honored (our GC does not use it)Ģ) The free callback will not be honored too (this is a current The best way is to use the RData structure, as you would do with the “cl_device_id” pointer on a IRB shell for instance. ![]() Struct? As an instance var? As an accessor? These later optionsĭoesn’t make sense to me, 'cause I’m never interested on getting the What’s the best way to store the pointer? Inside the Object Need to have a reference to that “cl_device_id” pointer somewhere. However, on other classes (think OpenCL::Context#new) I’ll How and were to store primitive values?įor instance, OpenCL::Device has somewhere inside a “cl_device_id” I’ll raise a couple of questions here, I’m sure you can The implementation (I basically copy-pasted code from other modulesĮheh). (mac)ruby C extension, and I’m not really sure about many details on Now there are a couple of things I need help. If you are interested on the actual hacky implementation, please It on my blog post here The branch with the code is located here on github. I wrote a small hack for MacRuby that adds basic (and hacky) supportįor OpenCL kernels running on your GPUs or CPUs. Hi promised Laurent I would start a discussion on OpenCL and Macruby On Jan 26, 2010, at 4:26 AM, Ruben Fonseca wrote: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |