Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CUDAQuickSurf.cu File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cuda.h>
#include "Inform.h"
#include "utilities.h"
#include "WKFThreads.h"
#include "WKFUtils.h"
#include "CUDAKernels.h"
#include "CUDAMarchingCubes.h"
#include "CUDAQuickSurf.h"
#include "DispCmds.h"
#include "VMDDisplayList.h"
#include <thrust/device_ptr.h>
#include <thrust/sort.h>

Go to the source code of this file.

Compounds

struct  qsurf_gpuhandle

Defines

#define CUERR
#define RESTRICT
#define MAXTHRSORTHASH   512
#define MINBLOCKSORTHASH   1
#define GRID_CELL_EMPTY   0xffffffff
#define GGRIDSZ   8.0f
#define GBLOCKSZX   8
#define GBLOCKSZY   8
#define GTEXBLOCKSZZ   2
#define GTEXUNROLL   4
#define GBLOCKSZZ   2
#define GUNROLL   4
#define MAXTHRDENS   ( GBLOCKSZX * GBLOCKSZY * GBLOCKSZZ )
#define MINBLOCKDENS   1

Functions

__device__ void convert_density (float &df, float df2)
__device__ void convert_density (unsigned short &dh, float df2)
__device__ void convert_color (float3 &cf, float3 cf2)
__device__ void convert_color (uchar4 &cu, float3 cf)
__device__ void convert_color (float3 &cf, uchar4 cu)
__global__ void hashAtoms (unsigned int natoms, const float4 *RESTRICT xyzr, int3 numvoxels, float invgridspacing, unsigned int *RESTRICT atomIndex, unsigned int *RESTRICT atomHash)
__global__ void sortAtomsGenCellLists (unsigned int natoms, const float4 *RESTRICT xyzr_d, const float4 *RESTRICT color_d, const unsigned int *atomIndex_d, const unsigned int *atomHash_d, float4 *RESTRICT sorted_xyzr_d, float4 *RESTRICT sorted_color_d, uint2 *RESTRICT cellStartEnd_d)
int vmd_cuda_build_density_atom_grid (int natoms, const float4 *xyzr_d, const float4 *color_d, float4 *sorted_xyzr_d, float4 *sorted_color_d, unsigned int *atomIndex_d, unsigned int *atomHash_d, uint2 *cellStartEnd_d, int3 volsz, float invgridspacing)
template<class DENSITY, class VOLTEX> __global__ void gaussdensity_fast_tex_norm (int natoms, const float4 *RESTRICT sorted_xyzr, const float4 *RESTRICT sorted_color, int3 numvoxels, int3 acncells, float acgridspacing, float invacgridspacing, const uint2 *RESTRICT cellStartEnd, float gridspacing, unsigned int z, DENSITY *RESTRICT densitygrid, VOLTEX *RESTRICT voltexmap, float invisovalue)
__global__ void gaussdensity_fast_tex3f (int natoms, const float4 *RESTRICT sorted_xyzr, const float4 *RESTRICT sorted_color, int3 numvoxels, int3 acncells, float acgridspacing, float invacgridspacing, const uint2 *RESTRICT cellStartEnd, float gridspacing, unsigned int z, float *RESTRICT densitygrid, float3 *RESTRICT voltexmap, float invisovalue)
__global__ void gaussdensity_fast (int natoms, const float4 *RESTRICT sorted_xyzr, int3 numvoxels, int3 acncells, float acgridspacing, float invacgridspacing, const uint2 *RESTRICT cellStartEnd, float gridspacing, unsigned int z, float *RESTRICT densitygrid)


Define Documentation

#define CUERR
 

Value:

{ cudaError_t err; \
  if ((err = cudaGetLastError()) != cudaSuccess) { \
  printf("CUDA error: %s, %s line %d\n", cudaGetErrorString(err), __FILE__, __LINE__); \
  printf("Thread aborting...\n"); \
  return NULL; }}

Definition at line 42 of file CUDAQuickSurf.cu.

#define GBLOCKSZX   8
 

Definition at line 298 of file CUDAQuickSurf.cu.

Referenced by CUDAQuickSurf::calc_surf.

#define GBLOCKSZY   8
 

Definition at line 299 of file CUDAQuickSurf.cu.

Referenced by CUDAQuickSurf::calc_surf.

#define GBLOCKSZZ   2
 

Definition at line 304 of file CUDAQuickSurf.cu.

Referenced by CUDAQuickSurf::calc_surf.

#define GGRIDSZ   8.0f
 

Definition at line 297 of file CUDAQuickSurf.cu.

#define GRID_CELL_EMPTY   0xffffffff
 

Definition at line 133 of file CUDAQuickSurf.cu.

Referenced by gaussdensity_fast, gaussdensity_fast_tex3f, gaussdensity_fast_tex_norm, and vmd_cuda_build_density_atom_grid.

#define GTEXBLOCKSZZ   2
 

Definition at line 302 of file CUDAQuickSurf.cu.

Referenced by CUDAQuickSurf::calc_surf.

#define GTEXUNROLL   4
 

Definition at line 303 of file CUDAQuickSurf.cu.

Referenced by CUDAQuickSurf::calc_surf, gaussdensity_fast_tex3f, and gaussdensity_fast_tex_norm.

#define GUNROLL   4
 

Definition at line 305 of file CUDAQuickSurf.cu.

Referenced by CUDAQuickSurf::calc_surf, and gaussdensity_fast.

#define MAXTHRDENS   ( GBLOCKSZX * GBLOCKSZY * GBLOCKSZZ )
 

Definition at line 320 of file CUDAQuickSurf.cu.

#define MAXTHRSORTHASH   512
 

Definition at line 120 of file CUDAQuickSurf.cu.

#define MINBLOCKDENS   1
 

Definition at line 321 of file CUDAQuickSurf.cu.

#define MINBLOCKSORTHASH   1
 

Definition at line 121 of file CUDAQuickSurf.cu.

#define RESTRICT
 

Definition at line 110 of file CUDAQuickSurf.cu.

Referenced by gaussdensity_fast, gaussdensity_fast_tex3f, gaussdensity_fast_tex_norm, hashAtoms, and sortAtomsGenCellLists.


Function Documentation

__device__ void convert_color float3 &    cf,
uchar4    cu
[inline]
 

Definition at line 96 of file CUDAQuickSurf.cu.

Referenced by gaussdensity_fast_tex_norm, generateTriangleColorNormal, and sampleColors.

__device__ void convert_color uchar4 &    cu,
float3    cf
[inline]
 

Definition at line 80 of file CUDAQuickSurf.cu.

__device__ void convert_color float3 &    cf,
float3    cf2
[inline]
 

Definition at line 74 of file CUDAQuickSurf.cu.

__device__ void convert_density unsigned short &    dh,
float    df2
[inline]
 

Definition at line 63 of file CUDAQuickSurf.cu.

Referenced by gaussdensity_fast_tex_norm.

__device__ void convert_density float &    df,
float    df2
[inline]
 

Definition at line 57 of file CUDAQuickSurf.cu.

__global__ void gaussdensity_fast int    natoms,
const float4 *RESTRICT    sorted_xyzr,
int3    numvoxels,
int3    acncells,
float    acgridspacing,
float    invacgridspacing,
const uint2 *RESTRICT    cellStartEnd,
float    gridspacing,
unsigned int    z,
float *RESTRICT    densitygrid
[static]
 

Definition at line 628 of file CUDAQuickSurf.cu.

References GRID_CELL_EMPTY, GUNROLL, and RESTRICT.

__global__ void gaussdensity_fast_tex3f int    natoms,
const float4 *RESTRICT    sorted_xyzr,
const float4 *RESTRICT    sorted_color,
int3    numvoxels,
int3    acncells,
float    acgridspacing,
float    invacgridspacing,
const uint2 *RESTRICT    cellStartEnd,
float    gridspacing,
unsigned int    z,
float *RESTRICT    densitygrid,
float3 *RESTRICT    voltexmap,
float    invisovalue
[static]
 

Definition at line 480 of file CUDAQuickSurf.cu.

References GRID_CELL_EMPTY, GTEXUNROLL, and RESTRICT.

template<class DENSITY, class VOLTEX>
__global__ void gaussdensity_fast_tex_norm int    natoms,
const float4 *RESTRICT    sorted_xyzr,
const float4 *RESTRICT    sorted_color,
int3    numvoxels,
int3    acncells,
float    acgridspacing,
float    invacgridspacing,
const uint2 *RESTRICT    cellStartEnd,
float    gridspacing,
unsigned int    z,
DENSITY *RESTRICT    densitygrid,
VOLTEX *RESTRICT    voltexmap,
float    invisovalue
[static]
 

Definition at line 334 of file CUDAQuickSurf.cu.

References convert_color, convert_density, GRID_CELL_EMPTY, GTEXUNROLL, and RESTRICT.

__global__ void hashAtoms unsigned int    natoms,
const float4 *RESTRICT    xyzr,
int3    numvoxels,
float    invgridspacing,
unsigned int *RESTRICT    atomIndex,
unsigned int *RESTRICT    atomHash
[static]
 

Definition at line 138 of file CUDAQuickSurf.cu.

References RESTRICT.

__global__ void sortAtomsGenCellLists unsigned int    natoms,
const float4 *RESTRICT    xyzr_d,
const float4 *RESTRICT    color_d,
const unsigned int *    atomIndex_d,
const unsigned int *    atomHash_d,
float4 *RESTRICT    sorted_xyzr_d,
float4 *RESTRICT    sorted_color_d,
uint2 *RESTRICT    cellStartEnd_d
[static]
 

Definition at line 170 of file CUDAQuickSurf.cu.

References NULL, and RESTRICT.

int vmd_cuda_build_density_atom_grid int    natoms,
const float4 *    xyzr_d,
const float4 *    color_d,
float4 *    sorted_xyzr_d,
float4 *    sorted_color_d,
unsigned int *    atomIndex_d,
unsigned int *    atomHash_d,
uint2 *    cellStartEnd_d,
int3    volsz,
float    invgridspacing
[static]
 

Definition at line 221 of file CUDAQuickSurf.cu.

References GRID_CELL_EMPTY.

Referenced by CUDAQuickSurf::calc_surf.


Generated on Fri May 24 01:49:27 2013 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002