This function returns a legal external pointer to a GPU card that will then be used to compute models.
The platform index to use for the GPU computation. If in doubt leave as the default (1).
The device index within the platform for the GPU computation. If in doubt leave as the default (1).
Logical; use double precision arithmetic. Double precision will re-create CPU calculations down to double precision accuracy. Single precision is not as accurate, but typically good to sub 1:1e6 relative error.
Some computers might have multiple platforms and devices available for GPU computation. The indices used refer to device number N on platform number M. If you have multiple cards then you might have more than one card device on a single platform, or single devices across multiple platforms.
If your computer has a single card (or you do not know what platforms and devices means with regards to GPUs) you probably want to leave the values as their defaults.
The output is an external pointer of class 'externalptr' to be parsed to
If there is any error building the OpenCL environment object an error is printed and NULL is returned.
Rodrigo Tobar & Aaron Robotham
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
modellist = list( sersic = list( xcen = c(180, 60), ycen = c(90, 10), mag = c(15, 13), re = c(14, 5), nser = c(3, 10), ang = c(46, 80), axrat = c(0.4, 0.6), box = c(0.5,-0.5) ), pointsource = list( xcen = c(34,10,150), ycen = c(74,120,130), mag = c(10,13,16) ), sky = list( bg = 3e-12 ) ) magimage(profitMakeModel(modellist=modellist, dim=c(200,200))) ## Not run: profitClearCache() tempCL=profitOpenCLEnv() magimage(profitMakeModel(modellist=modellist, dim=c(200,200), openclenv=tempCL)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.