QUDA  v1.1.0
A library for QCD on GPUs
Namespaces | Macros | Typedefs | Functions | Variables
quda_api.h File Reference
#include <cuda.h>
#include <cuda_runtime.h>
#include <enum_quda.h>

Go to the source code of this file.

Namespaces

 quda
 

Macros

#define STRINGIFY__(x)   #x
 
#define __STRINGIFY__(x)   STRINGIFY__(x)
 
#define qudaMemcpy(dst, src, count, kind)    ::quda::qudaMemcpy_(dst, src, count, kind, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaMemcpyAsync(dst, src, count, kind, stream)    ::quda::qudaMemcpyAsync_(dst, src, count, kind, stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaMemcpy2D(dst, dpitch, src, spitch, width, height, kind)
 
#define qudaMemcpy2DAsync(dst, dpitch, src, spitch, width, height, kind, stream)
 
#define qudaMemset(ptr, value, count)    ::quda::qudaMemset_(ptr, value, count, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaMemset2D(ptr, pitch, value, width, height)    ::quda::qudaMemset2D_(ptr, pitch, value, width, height, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaMemsetAsync(ptr, value, count, stream)    ::quda::qudaMemsetAsync_(ptr, value, count, stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaMemset2DAsync(ptr, pitch, value, width, height, stream)
 
#define qudaMemPrefetchAsync(ptr, count, mem_space, stream)
 
#define qudaEventQuery(event)    ::quda::qudaEventQuery_(event, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaEventRecord(event, stream)    ::quda::qudaEventRecord_(event, stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaStreamWaitEvent(stream, event, flags)    ::quda::qudaStreamWaitEvent_(stream, event, flags, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaEventSynchronize(event)    ::quda::qudaEventSynchronize_(event, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaStreamSynchronize(stream)    ::quda::qudaStreamSynchronize_(stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 
#define qudaDeviceSynchronize()    ::quda::qudaDeviceSynchronize_(__func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
 

Typedefs

using qudaStream_t = cudaStream_t
 

Functions

qudaError_t quda::qudaLaunchKernel (const void *func, const TuneParam &tp, void **args, qudaStream_t stream)
 Wrapper around cudaLaunchKernel. More...
 
template<typename T , typename... Arg>
qudaError_t quda::qudaLaunchKernel (T *func, const TuneParam &tp, qudaStream_t stream, const Arg &... arg)
 Templated wrapper around qudaLaunchKernel which can accept a templated kernel, and expects a kernel with a single Arg argument. More...
 
void quda::qudaMemcpy_ (void *dst, const void *src, size_t count, cudaMemcpyKind kind, const char *func, const char *file, const char *line)
 Wrapper around cudaMemcpy or driver API equivalent. More...
 
void quda::qudaMemcpyAsync_ (void *dst, const void *src, size_t count, cudaMemcpyKind kind, const qudaStream_t &stream, const char *func, const char *file, const char *line)
 Wrapper around cudaMemcpyAsync or driver API equivalent. More...
 
void quda::qudaMemcpy2D_ (void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, const char *func, const char *file, const char *line)
 Wrapper around cudaMemcpy2DAsync or driver API equivalent. More...
 
void quda::qudaMemcpy2DAsync_ (void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, const qudaStream_t &stream, const char *func, const char *file, const char *line)
 Wrapper around cudaMemcpy2DAsync or driver API equivalent. More...
 
void quda::qudaMemset_ (void *ptr, int value, size_t count, const char *func, const char *file, const char *line)
 Wrapper around cudaMemset or driver API equivalent. More...
 
void quda::qudaMemset2D_ (void *ptr, size_t pitch, int value, size_t width, size_t height, const char *func, const char *file, const char *line)
 Wrapper around cudaMemset2D or driver API equivalent. More...
 
void quda::qudaMemsetAsync_ (void *ptr, int value, size_t count, const qudaStream_t &stream, const char *func, const char *file, const char *line)
 Wrapper around cudaMemsetAsync or driver API equivalent. More...
 
void quda::qudaMemset2DAsync_ (void *ptr, size_t pitch, int value, size_t width, size_t height, const qudaStream_t &stream, const char *func, const char *file, const char *line)
 Wrapper around cudaMemsetAsync or driver API equivalent. More...
 
void quda::qudaMemPrefetchAsync_ (void *ptr, size_t count, QudaFieldLocation mem_space, const qudaStream_t &stream, const char *func, const char *file, const char *line)
 Wrapper around cudaMemPrefetchAsync or driver API equivalent. More...
 
bool quda::qudaEventQuery_ (cudaEvent_t &event, const char *func, const char *file, const char *line)
 Wrapper around cudaEventQuery or cuEventQuery with built-in error checking. More...
 
void quda::qudaEventRecord_ (cudaEvent_t &event, qudaStream_t stream, const char *func, const char *file, const char *line)
 Wrapper around cudaEventRecord or cuEventRecord with built-in error checking. More...
 
void quda::qudaStreamWaitEvent_ (qudaStream_t stream, cudaEvent_t event, unsigned int flags, const char *func, const char *file, const char *line)
 Wrapper around cudaStreamWaitEvent or cuStreamWaitEvent with built-in error checking. More...
 
void quda::qudaEventSynchronize_ (cudaEvent_t &event, const char *func, const char *file, const char *line)
 Wrapper around cudaEventSynchronize or cuEventSynchronize with built-in error checking. More...
 
void quda::qudaStreamSynchronize_ (qudaStream_t &stream, const char *func, const char *file, const char *line)
 Wrapper around cudaStreamSynchronize or cuStreamSynchronize with built-in error checking. More...
 
void quda::qudaDeviceSynchronize_ (const char *func, const char *file, const char *line)
 Wrapper around cudaDeviceSynchronize or cuDeviceSynchronize with built-in error checking. More...
 
void quda::printAPIProfile ()
 Print out the timer profile for CUDA API calls. More...
 

Variables

cudaDeviceProp deviceProp
 

Detailed Description

Wrappers around CUDA API function calls allowing us to easily profile and switch between using the CUDA runtime and driver APIs.

Definition in file quda_api.h.

Macro Definition Documentation

◆ __STRINGIFY__

#define __STRINGIFY__ (   x)    STRINGIFY__(x)

Definition at line 202 of file quda_api.h.

◆ qudaDeviceSynchronize

#define qudaDeviceSynchronize ( )     ::quda::qudaDeviceSynchronize_(__func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 250 of file quda_api.h.

◆ qudaEventQuery

#define qudaEventQuery (   event)     ::quda::qudaEventQuery_(event, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 235 of file quda_api.h.

◆ qudaEventRecord

#define qudaEventRecord (   event,
  stream 
)     ::quda::qudaEventRecord_(event, stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 238 of file quda_api.h.

◆ qudaEventSynchronize

#define qudaEventSynchronize (   event)     ::quda::qudaEventSynchronize_(event, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 244 of file quda_api.h.

◆ qudaMemcpy

#define qudaMemcpy (   dst,
  src,
  count,
  kind 
)     ::quda::qudaMemcpy_(dst, src, count, kind, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 204 of file quda_api.h.

◆ qudaMemcpy2D

#define qudaMemcpy2D (   dst,
  dpitch,
  src,
  spitch,
  width,
  height,
  kind 
)
Value:
::quda::qudaMemcpy2D_(dst, dpitch, src, spitch, width, height, kind, __func__, quda::file_name(__FILE__), \
__STRINGIFY__(__LINE__))
constexpr const char * file_name(const char *str)
Definition: malloc_quda.h:83
void qudaMemcpy2D_(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, const char *func, const char *file, const char *line)
Wrapper around cudaMemcpy2DAsync or driver API equivalent.
Definition: quda_api.cpp:272
#define __STRINGIFY__(x)
Definition: quda_api.h:202

Definition at line 210 of file quda_api.h.

◆ qudaMemcpy2DAsync

#define qudaMemcpy2DAsync (   dst,
  dpitch,
  src,
  spitch,
  width,
  height,
  kind,
  stream 
)
Value:
::quda::qudaMemcpy2DAsync_(dst, dpitch, src, spitch, width, height, kind, stream, __func__, \
quda::file_name(__FILE__), __STRINGIFY__(__LINE__))
qudaStream_t * stream
void qudaMemcpy2DAsync_(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, cudaMemcpyKind kind, const qudaStream_t &stream, const char *func, const char *file, const char *line)
Wrapper around cudaMemcpy2DAsync or driver API equivalent.
Definition: quda_api.cpp:301

Definition at line 214 of file quda_api.h.

◆ qudaMemcpyAsync

#define qudaMemcpyAsync (   dst,
  src,
  count,
  kind,
  stream 
)     ::quda::qudaMemcpyAsync_(dst, src, count, kind, stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 207 of file quda_api.h.

◆ qudaMemPrefetchAsync

#define qudaMemPrefetchAsync (   ptr,
  count,
  mem_space,
  stream 
)
Value:
::quda::qudaMemPrefetchAsync_(ptr, count, mem_space, stream, __func__, quda::file_name(__FILE__), \
__STRINGIFY__(__LINE__))
void qudaMemPrefetchAsync_(void *ptr, size_t count, QudaFieldLocation mem_space, const qudaStream_t &stream, const char *func, const char *file, const char *line)
Wrapper around cudaMemPrefetchAsync or driver API equivalent.
Definition: quda_api.cpp:363

Definition at line 231 of file quda_api.h.

◆ qudaMemset

#define qudaMemset (   ptr,
  value,
  count 
)     ::quda::qudaMemset_(ptr, value, count, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 218 of file quda_api.h.

◆ qudaMemset2D

#define qudaMemset2D (   ptr,
  pitch,
  value,
  width,
  height 
)     ::quda::qudaMemset2D_(ptr, pitch, value, width, height, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 221 of file quda_api.h.

◆ qudaMemset2DAsync

#define qudaMemset2DAsync (   ptr,
  pitch,
  value,
  width,
  height,
  stream 
)
Value:
::quda::qudaMemset2DAsync_(ptr, pitch, value, width, height, stream, __func__, quda::file_name(__FILE__), \
__STRINGIFY__(__LINE__))
void qudaMemset2DAsync_(void *ptr, size_t pitch, int value, size_t width, size_t height, const qudaStream_t &stream, const char *func, const char *file, const char *line)
Wrapper around cudaMemsetAsync or driver API equivalent.
Definition: quda_api.cpp:356

Definition at line 227 of file quda_api.h.

◆ qudaMemsetAsync

#define qudaMemsetAsync (   ptr,
  value,
  count,
  stream 
)     ::quda::qudaMemsetAsync_(ptr, value, count, stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 224 of file quda_api.h.

◆ qudaStreamSynchronize

#define qudaStreamSynchronize (   stream)     ::quda::qudaStreamSynchronize_(stream, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 247 of file quda_api.h.

◆ qudaStreamWaitEvent

#define qudaStreamWaitEvent (   stream,
  event,
  flags 
)     ::quda::qudaStreamWaitEvent_(stream, event, flags, __func__, quda::file_name(__FILE__), __STRINGIFY__(__LINE__))

Definition at line 241 of file quda_api.h.

◆ STRINGIFY__

#define STRINGIFY__ (   x)    #x

Definition at line 201 of file quda_api.h.

Typedef Documentation

◆ qudaStream_t

using qudaStream_t = cudaStream_t

Definition at line 9 of file quda_api.h.

Variable Documentation

◆ deviceProp

cudaDeviceProp deviceProp
extern

Definition at line 14 of file device.cpp.