| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 | /* * This file is part of the StarPU Handbook. * Copyright (C) 2009--2011  Universit@'e de Bordeaux * Copyright (C) 2010, 2011, 2012, 2013, 2015  CNRS * Copyright (C) 2011, 2012 INRIA * See the file version.doxy for copying conditions. *//*! \defgroup API_CUDA_Extensions CUDA Extensions\def STARPU_USE_CUDA\ingroup API_CUDA_ExtensionsThis macro is defined when StarPU has been installed with CUDAsupport. It should be used in your code to detect the availability ofCUDA as shown in \ref FullSourceCodeVectorScal.\def STARPU_MAXCUDADEVS\ingroup API_CUDA_ExtensionsThis macro defines the maximum number of CUDA devices that aresupported by StarPU.\fn cudaStream_t starpu_cuda_get_local_stream(void)\ingroup API_CUDA_ExtensionsThis function gets the current worker’s CUDA stream. StarPUprovides a stream for every CUDA device controlled by StarPU. Thisfunction is only provided for convenience so that programmers caneasily use asynchronous operations within codelets without having tocreate a stream by hand. Note that the application is not forced touse the stream provided by starpu_cuda_get_local_stream() and may alsocreate its own streams. Synchronizing with cudaThreadSynchronize() isallowed, but will reduce the likelihood of having all transfersoverlapped.\fn const struct cudaDeviceProp *starpu_cuda_get_device_properties(unsigned workerid)\ingroup API_CUDA_ExtensionsThis function returns a pointer to device properties for worker\p workerid (assumed to be a CUDA worker).\fn void starpu_cuda_report_error(const char *func, const char *file, int line, cudaError_t status)\ingroup API_CUDA_ExtensionsReport a CUDA error.\def STARPU_CUDA_REPORT_ERROR(status)\ingroup API_CUDA_ExtensionsCalls starpu_cuda_report_error(), passing the current function, file and line position.\fn int starpu_cuda_copy_async_sync(void *src_ptr, unsigned src_node, void *dst_ptr, unsigned dst_node, size_t ssize, cudaStream_t stream, enum cudaMemcpyKind kind)\ingroup API_CUDA_ExtensionsCopy \p ssize bytes from the pointer \p src_ptr on \p src_nodeto the pointer \p dst_ptr on \p dst_node. The function first tries tocopy the data asynchronous (unless stream is <c>NULL</c>). If theasynchronous copy fails or if stream is <c>NULL</c>, it copies thedata synchronously. The function returns <c>-EAGAIN</c> if theasynchronous launch was successfull. It returns 0 if the synchronouscopy was successful, or fails otherwise.\fn void starpu_cuda_set_device(unsigned devid)\ingroup API_CUDA_ExtensionsCalls cudaSetDevice(devid) or cudaGLSetGLDevice(devid),according to whether \p devid is among the fieldstarpu_conf::cuda_opengl_interoperability.\fn void starpu_cublas_init(void)\ingroup API_CUDA_ExtensionsThis function initializes CUBLAS on every CUDA device. TheCUBLAS library must be initialized prior to any CUBLAS call. Callingstarpu_cublas_init() will initialize CUBLAS on every CUDA devicecontrolled by StarPU. This call blocks until CUBLAS has been properlyinitialized on every device.\fn void starpu_cublas_shutdown(void)\ingroup API_CUDA_ExtensionsThis function synchronously deinitializes the CUBLAS library onevery CUDA device.\fn void starpu_cublas_report_error(const char *func, const char *file, int line, int status)\ingroup API_CUDA_ExtensionsReport a cublas error.\def STARPU_CUBLAS_REPORT_ERROR(status)\ingroup API_CUDA_ExtensionsCalls starpu_cublas_report_error(), passing the currentfunction, file and line position.*/
 |