;+ ; NAME: ; spheretool_gpu_detect ; ; PURPOSE: ; Determine whether or not spheretool can run with GPU acceleration. ; ; CATEGORY: ; Holographic video microscopy ; ; CALLING SEQUENCE: ; Internal routine. Not intended for independent use. ; gpu = spheretool_gpu_detect() ; ; OUTPUTS: ; gpu: 1 if GPU present and correctly initialized, ; 0 otherwise ; ; SIDE EFFECTS: ; Initializes GPULIB, if present and hardware permits ; ; RESTRICTIONS: ; GPU acceleration requires working installation of GPULIB ; and suitable hardware. ; ; PROCEDURE: ; Catch potential errors when an attempt is made to run ; GPUINIT, /HARDWARE ; ; MODIFICATION HISTORY: ; 03/20/2009: David G. Grier, New York University. Adapted from ; GPU_DETECT() posted on Mike Galloy's GPULIB blog. ; ; LICENSE ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation; either version 2 of the ; License, or (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ; General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ; 02111-1307 USA ; ; If the Internet and WWW are still functional when you are using ; this, you shold be able to access the GPL here: ; http://www.gnu.org/copyleft/gpl.html ;- function spheretool_gpu_detect compile_opt idl2, hidden catch, error if (error ne 0L) then begin catch, /cancel return, 0 endif gpuinit, /HARDWARE return, 1 end