kspaceFirstOrder3D-CUDA  1.1
The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CUDAUtils.cuh File Reference

The header file with CUDA utility functions. These routines are to be inlined. More...

Include dependency graph for CUDAUtils.cuh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

__device__ unsigned int GetIndex ()
 Get global 1D coordinate for 1D CUDA block. More...
 
__device__ unsigned int GetStride ()
 Get x-stride for 3D CUDA block (for processing multiple grid points by a single thread). More...
 
__device__ dim3 GetReal3DCoords (const unsigned int i)
 Get 3D coordinates for a real matrix form a 1D index. More...
 
__device__ dim3 GetComplex3DCoords (const unsigned int i)
 Get a 3D coordinates for a complex matrix form a 1D index. More...
 
__device__ float2 operator* (const float2 a, const float2 b)
 Operator * for float2 datatype (per element multiplication). More...
 
__device__ float2 operator* (const float2 a, const float b)
 Operator * for float2 datatype (per element multiplication). More...
 
__device__ float2 operator* (const float b, const float2 a)
 Operator * for float2 datatype (per element multiplication). More...
 
__device__ void operator*= (float2 &a, const float2 b)
 Operator *= for float2 datatype (per element multiplication). More...
 
__device__ void operator*= (float2 &a, const float b)
 Operator *= for float2 datatype (per element multiplication). More...
 
__device__ float2 operator+ (const float2 a, const float2 b)
 Operator + for float2 datatype (per element multiplication). More...
 
__device__ float2 operator+ (const float2 a, const float b)
 Operator + for float2 datatype (per element multiplication) More...
 
__device__ float2 operator+ (const float b, const float2 a)
 Operator + for float2 datatype (per element multiplication). More...
 
__device__ void operator+= (float2 &a, const float2 b)
 Operator += for float2 datatype (per element multiplication). More...
 
__device__ void operator+= (float2 &a, const float b)
 Operator += for float2 datatype (per element multiplication). More...
 

Variables

__constant__ TCUDADeviceConstants cudaDeviceConstants
 This variable holds basic simulation constants for GPU. More...
 

Detailed Description

Author
Jiri Jaros
Faculty of Information Technology
Brno University of Technology
jaros.nosp@m.jir@.nosp@m.fit.v.nosp@m.utbr.nosp@m..cz
Version
kspaceFirstOrder3D 3.4
Date
22 March 2016, 15:25 (created)
25 July 2016, 10:56 (revised)

License

This file is part of the C++ extension of the k-Wave Toolbox (http://www.k-wave.org).
Copyright (C) 2016 Jiri Jaros and Bradley Treeby.

This file is part of the k-Wave. k-Wave is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

k-Wave 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with k-Wave. If not, see http://www.gnu.org/licenses/.

Definition in file CUDAUtils.cuh.

Function Documentation

__device__ dim3 GetComplex3DCoords ( const unsigned int  i)
inline

Get a 3D coordinates for a complex matrix form a 1D index.

Parameters
[in]i- index
Returns
3D coordinates

Definition at line 97 of file CUDAUtils.cuh.

Here is the caller graph for this function:

__device__ unsigned int GetIndex ( )
inline

Get global 1D coordinate for 1D CUDA block.

Returns
x-coordinate for 1D CUDA block

Definition at line 57 of file CUDAUtils.cuh.

Here is the caller graph for this function:

__device__ dim3 GetReal3DCoords ( const unsigned int  i)
inline

Get 3D coordinates for a real matrix form a 1D index.

Parameters
[in]i- index
Returns
3D coordinates

Definition at line 82 of file CUDAUtils.cuh.

Here is the caller graph for this function:

__device__ unsigned int GetStride ( )
inline

Get x-stride for 3D CUDA block (for processing multiple grid points by a single thread).

Returns
x stride for 3D CUDA block

Definition at line 69 of file CUDAUtils.cuh.

Here is the caller graph for this function:

__device__ float2 operator* ( const float2  a,
const float2  b 
)
inline

Operator * for float2 datatype (per element multiplication).

Parameters
[in]a
[in]b
Returns
a.x * b.x, a.y * b.y

Definition at line 118 of file CUDAUtils.cuh.

__device__ float2 operator* ( const float2  a,
const float  b 
)
inline

Operator * for float2 datatype (per element multiplication).

Parameters
[in]a
[in]b
Returns
a.x * b, a.y * b

Definition at line 133 of file CUDAUtils.cuh.

__device__ float2 operator* ( const float  b,
const float2  a 
)
inline

Operator * for float2 datatype (per element multiplication).

Parameters
[in]a
[in]b
Returns
a * b.x, a * b.y

Definition at line 148 of file CUDAUtils.cuh.

__device__ void operator*= ( float2 &  a,
const float2  b 
)
inline

Operator *= for float2 datatype (per element multiplication).

Parameters
[in,out]a
[in]b
Returns
a.x *= b.x, a.y *= b.y

Definition at line 164 of file CUDAUtils.cuh.

__device__ void operator*= ( float2 &  a,
const float  b 
)
inline

Operator *= for float2 datatype (per element multiplication).

Parameters
[in,out]a
[in]b
Returns
a.x =* b, a.y =* b

Definition at line 180 of file CUDAUtils.cuh.

__device__ float2 operator+ ( const float2  a,
const float2  b 
)
inline

Operator + for float2 datatype (per element multiplication).

Parameters
[in]a
[in]b
Returns
a.x + b.x, a.y + b.y

Definition at line 199 of file CUDAUtils.cuh.

__device__ float2 operator+ ( const float2  a,
const float  b 
)
inline

Operator + for float2 datatype (per element multiplication).

Parameters
[in]a
[in]b
Returns
a.x + b, a.y + b

Definition at line 214 of file CUDAUtils.cuh.

__device__ float2 operator+ ( const float  b,
const float2  a 
)
inline

Operator + for float2 datatype (per element multiplication).

Parameters
[in]a
[in]b
Returns
a + b.x, a + b.y

Definition at line 229 of file CUDAUtils.cuh.

__device__ void operator+= ( float2 &  a,
const float2  b 
)
inline

Operator += for float2 datatype (per element multiplication)

Parameters
[in,out]a
[in]b
Returns
a.x += b.x, a.y += b.y

Definition at line 245 of file CUDAUtils.cuh.

__device__ void operator+= ( float2 &  a,
const float  b 
)
inline

Operator += for float2 datatype (per element multiplication).

Parameters
[in,out]a
[in]b
Returns
a.x += b, a.y += b

Definition at line 260 of file CUDAUtils.cuh.

Variable Documentation

__constant__ TCUDADeviceConstants cudaDeviceConstants

This variable holds necessary simulation constants in the CUDA GPU memory. The variable is defined in CUDADeviceConstants.cu

This variable holds necessary simulation constants in the CUDA GPU memory. The variable is defined in TCUDADeviceConstants.cu

This variable holds necessary simulation constants in the CUDA GPU. memory. This variable is imported as extern into other CUDA units

Definition at line 54 of file CUDADeviceConstants.cu.