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

CUDASpatialSearch.cu File Reference

CUDA kernels that build data structures for spatial sorting, hashing, and searching, used by QuickSurf, MDFF, etc. More...

#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 "CUDASpatialSearch.h"
#include "CUDASort.h"
#include "AtomSel.h"
#include "VMDApp.h"
#include "MoleculeList.h"
#include "VolumetricData.h"
#include "VolMapCreate.h"
#include <tcl.h>
#include "TclCommands.h"

Go to the source code of this file.

Defines

#define CUERR
#define RESTRICT
#define MAXTHRSORTHASH   512
#define MINBLOCKSORTHASH   1
#define GRID_CELL_EMPTY   0xffffffff

Functions

__global__ void hashAtoms (unsigned int natoms, const float4 *RESTRICT xyzr, int3 numcells, float invgridspacing, unsigned int *RESTRICT atomIndex, unsigned int *RESTRICT atomHash)
__global__ void sortAtomsColorsGenCellLists (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)
__global__ void sortAtomsGenCellLists (unsigned int natoms, const float4 *RESTRICT xyzr_d, const unsigned int *atomIndex_d, const unsigned int *atomHash_d, float4 *RESTRICT sorted_xyzr_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)
int vmd_cuda_build_density_atom_grid (int natoms, const float4 *xyzr_d, float4 *&sorted_xyzr_d, uint2 *&cellStartEnd_d, int3 volsz, float invgridspacing)


Detailed Description

CUDA kernels that build data structures for spatial sorting, hashing, and searching, used by QuickSurf, MDFF, etc.

Definition in file CUDASpatialSearch.cu.


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 49 of file CUDASpatialSearch.cu.

#define GRID_CELL_EMPTY   0xffffffff
 

Definition at line 86 of file CUDASpatialSearch.cu.

Referenced by vmd_cuda_build_density_atom_grid.

#define MAXTHRSORTHASH   512
 

Definition at line 75 of file CUDASpatialSearch.cu.

#define MINBLOCKSORTHASH   1
 

Definition at line 76 of file CUDASpatialSearch.cu.

#define RESTRICT
 

Definition at line 65 of file CUDASpatialSearch.cu.

Referenced by hashAtoms, sortAtomsColorsGenCellLists, and sortAtomsGenCellLists.


Function Documentation

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

Definition at line 91 of file CUDASpatialSearch.cu.

References RESTRICT.

__global__ void sortAtomsColorsGenCellLists 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 120 of file CUDASpatialSearch.cu.

References NULL, and RESTRICT.

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

Definition at line 175 of file CUDASpatialSearch.cu.

References RESTRICT.

int vmd_cuda_build_density_atom_grid int    natoms,
const float4 *    xyzr_d,
float4 *&    sorted_xyzr_d,
uint2 *&    cellStartEnd_d,
int3    volsz,
float    invgridspacing
 

Definition at line 290 of file CUDASpatialSearch.cu.

References dev_radix_sort_by_key, GRID_CELL_EMPTY, NULL, and volsz.

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
 

Definition at line 219 of file CUDASpatialSearch.cu.

References dev_radix_sort_by_key, GRID_CELL_EMPTY, NULL, and volsz.


Generated on Sat Nov 9 02:45:55 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002