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

OpenCLOrbital.C File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <CL/cl.h>
#include "WKFThreads.h"
#include "OpenCLKernels.h"

Go to the source code of this file.

Compounds

union  flint_t
struct  orbthrparms

Defines

#define CLERR
#define UNROLLX   1
#define UNROLLY   1
#define BLOCKSIZEX   8
#define BLOCKSIZEY   8
#define BLOCKSIZE   BLOCKSIZEX * BLOCKSIZEY
#define TILESIZEX   BLOCKSIZEX*UNROLLX
#define TILESIZEY   BLOCKSIZEY*UNROLLY
#define GPU_X_ALIGNMASK   (TILESIZEX - 1)
#define GPU_Y_ALIGNMASK   (TILESIZEY - 1)
#define V4UNROLLX   4
#define V4UNROLLY   1
#define V4BLOCKSIZEX   2
#define V4BLOCKSIZEY   8
#define V4BLOCKSIZE   BLOCKSIZEX * BLOCKSIZEY
#define V4TILESIZEX   V4BLOCKSIZEX*V4UNROLLX
#define V4TILESIZEY   V4BLOCKSIZEY*V4UNROLLY
#define V4GPU_X_ALIGNMASK   (V4TILESIZEX - 1)
#define V4GPU_Y_ALIGNMASK   (V4TILESIZEY - 1)
#define MEMCOALESCE   384
#define S_SHELL   0
#define P_SHELL   1
#define D_SHELL   2
#define F_SHELL   3
#define G_SHELL   4
#define H_SHELL   5
#define MAX_ATOM_SZ   256
#define MAX_ATOMPOS_SZ   (MAX_ATOM_SZ)
#define MAX_ATOM_BASIS_SZ   (MAX_ATOM_SZ)
#define MAX_ATOMSHELL_SZ   (MAX_ATOM_SZ)
#define MAX_BASIS_SZ   6144
#define MAX_SHELL_SZ   1024
#define MAX_WAVEF_SZ   6144
#define MAXSHELLCOUNT   15
#define MEMCOAMASK   (~15)
#define SHAREDSIZE   256

Typedefs

typedef flint_t flint

Functions

void * openclorbitalthread (void *)
cl_program vmd_opencl_compile_orbital_pgm (cl_context clctx, cl_device_id *cldevs, int &clerr)
vmd_opencl_orbital_handlevmd_opencl_create_orbital_handle (cl_context ctx, cl_command_queue cmdq, cl_device_id *devs)
int vmd_opencl_destroy_orbital_handle (vmd_opencl_orbital_handle *orbh)
int computepaddedsize (int orig, int tilesize)
int vmd_opencl_evaluate_orbital_grid (wkf_threadpool_t *devpool, vmd_opencl_orbital_handle *orbh, int numatoms, const float *wave_f, int num_wave_f, const float *basis_array, int num_basis, const float *atompos, const int *atom_basis, const int *num_shells_per_atom, const int *num_prim_per_shell, const int *shell_symmetry, int num_shells, const int *numvoxels, float voxelsize, const float *origin, int density, float *orbitalgrid)

Variables

const char * clorbitalsrc


Define Documentation

#define BLOCKSIZE   BLOCKSIZEX * BLOCKSIZEY
 

Definition at line 78 of file OpenCLOrbital.C.

Referenced by vmd_opencl_compile_orbital_pgm.

#define BLOCKSIZEX   8
 

Definition at line 76 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define BLOCKSIZEY   8
 

Definition at line 77 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define CLERR
 

Value:

if (clerr != CL_SUCCESS) {                     \
    printf("opencl error %d, %s line %d\n", clerr, __FILE__, __LINE__); \
    return NULL;                                   \
  }

Definition at line 36 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, vmd_opencl_compile_orbital_pgm, and vmd_opencl_create_orbital_handle.

#define D_SHELL   2
 

Definition at line 103 of file OpenCLOrbital.C.

#define F_SHELL   3
 

Definition at line 104 of file OpenCLOrbital.C.

#define G_SHELL   4
 

Definition at line 105 of file OpenCLOrbital.C.

#define GPU_X_ALIGNMASK   (TILESIZEX - 1)
 

Definition at line 83 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define GPU_Y_ALIGNMASK   (TILESIZEY - 1)
 

Definition at line 84 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define H_SHELL   5
 

Definition at line 106 of file OpenCLOrbital.C.

#define MAX_ATOM_BASIS_SZ   (MAX_ATOM_SZ)
 

Definition at line 113 of file OpenCLOrbital.C.

#define MAX_ATOM_SZ   256
 

Definition at line 111 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define MAX_ATOMPOS_SZ   (MAX_ATOM_SZ)
 

Definition at line 112 of file OpenCLOrbital.C.

#define MAX_ATOMSHELL_SZ   (MAX_ATOM_SZ)
 

Definition at line 114 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define MAX_BASIS_SZ   6144
 

Definition at line 115 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define MAX_SHELL_SZ   1024
 

Definition at line 116 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define MAX_WAVEF_SZ   6144
 

Definition at line 117 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define MAXSHELLCOUNT   15
 

Definition at line 132 of file OpenCLOrbital.C.

Referenced by vmd_opencl_compile_orbital_pgm.

#define MEMCOALESCE   384
 

Definition at line 98 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define MEMCOAMASK   (~15)
 

Definition at line 138 of file OpenCLOrbital.C.

Referenced by vmd_opencl_compile_orbital_pgm.

#define P_SHELL   1
 

Definition at line 102 of file OpenCLOrbital.C.

#define S_SHELL   0
 

Definition at line 101 of file OpenCLOrbital.C.

#define SHAREDSIZE   256
 

Definition at line 145 of file OpenCLOrbital.C.

Referenced by vmd_opencl_compile_orbital_pgm.

#define TILESIZEX   BLOCKSIZEX*UNROLLX
 

Definition at line 81 of file OpenCLOrbital.C.

#define TILESIZEY   BLOCKSIZEY*UNROLLY
 

Definition at line 82 of file OpenCLOrbital.C.

#define UNROLLX   1
 

Definition at line 74 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define UNROLLY   1
 

Definition at line 75 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define V4BLOCKSIZE   BLOCKSIZEX * BLOCKSIZEY
 

Definition at line 90 of file OpenCLOrbital.C.

#define V4BLOCKSIZEX   2
 

Definition at line 88 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define V4BLOCKSIZEY   8
 

Definition at line 89 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define V4GPU_X_ALIGNMASK   (V4TILESIZEX - 1)
 

Definition at line 95 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define V4GPU_Y_ALIGNMASK   (V4TILESIZEY - 1)
 

Definition at line 96 of file OpenCLOrbital.C.

Referenced by openclorbitalthread.

#define V4TILESIZEX   V4BLOCKSIZEX*V4UNROLLX
 

Definition at line 93 of file OpenCLOrbital.C.

#define V4TILESIZEY   V4BLOCKSIZEY*V4UNROLLY
 

Definition at line 94 of file OpenCLOrbital.C.

#define V4UNROLLX   4
 

Definition at line 86 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.

#define V4UNROLLY   1
 

Definition at line 87 of file OpenCLOrbital.C.

Referenced by openclorbitalthread, and vmd_opencl_compile_orbital_pgm.


Typedef Documentation

typedef union flint_t flint
 


Function Documentation

int computepaddedsize int    orig,
int    tilesize
[static]
 

Definition at line 745 of file OpenCLOrbital.C.

Referenced by cudaorbitalthread, and openclorbitalthread.

void * openclorbitalthread void *    [static]
 

Definition at line 752 of file OpenCLOrbital.C.

References orbthrparms::atom_basis, orbthrparms::atompos, orbthrparms::basis_array, BLOCKSIZEX, BLOCKSIZEY, CLERR, vmd_opencl_orbital_handle::cmdq, computepaddedsize, vmd_opencl_orbital_handle::ctx, orbthrparms::density, wkf_tasktile_struct::end, flint_t::f, GPU_X_ALIGNMASK, GPU_Y_ALIGNMASK, flint_t::i, vmd_opencl_orbital_handle::kconstmem, vmd_opencl_orbital_handle::kconstmem_vec4, vmd_opencl_orbital_handle::ktiledshared, MAX_ATOM_SZ, MAX_ATOMSHELL_SZ, MAX_BASIS_SZ, MAX_SHELL_SZ, MAX_WAVEF_SZ, MEMCOALESCE, NULL, orbthrparms::num_basis, orbthrparms::num_prim_per_shell, orbthrparms::num_shells, orbthrparms::num_shells_per_atom, orbthrparms::num_wave_f, orbthrparms::numatoms, orbthrparms::numvoxels, orbthrparms::orbh, orbthrparms::orbitalgrid, orbthrparms::origin, orbthrparms::shell_symmetry, wkf_tasktile_struct::start, UNROLLX, UNROLLY, V4BLOCKSIZEX, V4BLOCKSIZEY, V4GPU_X_ALIGNMASK, V4GPU_Y_ALIGNMASK, V4UNROLLX, V4UNROLLY, orbthrparms::voxelsize, orbthrparms::wave_f, WKF_SCHED_DONE, wkf_threadlaunch_getdata, wkf_threadlaunch_getid, wkf_threadlaunch_next_tile, wkf_threadpool_next_tile, wkf_threadpool_worker_devscaletile, wkf_threadpool_worker_getdata, and wkf_threadpool_worker_getid.

Referenced by vmd_opencl_evaluate_orbital_grid.

cl_program vmd_opencl_compile_orbital_pgm cl_context    clctx,
cl_device_id *    cldevs,
int &    clerr
 

Definition at line 684 of file OpenCLOrbital.C.

References BLOCKSIZE, BLOCKSIZEX, BLOCKSIZEY, CLERR, clorbitalsrc, MAXSHELLCOUNT, MEMCOAMASK, NULL, SHAREDSIZE, UNROLLX, UNROLLY, V4BLOCKSIZEX, V4BLOCKSIZEY, V4UNROLLX, and V4UNROLLY.

Referenced by vmd_opencl_create_orbital_handle.

vmd_opencl_orbital_handle* vmd_opencl_create_orbital_handle cl_context    ctx,
cl_command_queue    cmdq,
cl_device_id *    devs
 

Definition at line 711 of file OpenCLOrbital.C.

References CLERR, vmd_opencl_orbital_handle::cmdq, vmd_opencl_orbital_handle::ctx, vmd_opencl_orbital_handle::devs, vmd_opencl_orbital_handle::kconstmem, vmd_opencl_orbital_handle::kconstmem_vec4, vmd_opencl_orbital_handle::ktiledshared, vmd_opencl_orbital_handle::pgm, and vmd_opencl_compile_orbital_pgm.

Referenced by Orbital::calculate_mo.

int vmd_opencl_destroy_orbital_handle vmd_opencl_orbital_handle   orbh
 

Definition at line 733 of file OpenCLOrbital.C.

References vmd_opencl_orbital_handle::kconstmem, vmd_opencl_orbital_handle::kconstmem_vec4, vmd_opencl_orbital_handle::ktiledshared, and vmd_opencl_orbital_handle::pgm.

Referenced by Orbital::calculate_mo.

int vmd_opencl_evaluate_orbital_grid wkf_threadpool_t   devpool,
vmd_opencl_orbital_handle   orbh,
int    numatoms,
const float *    wave_f,
int    num_wave_f,
const float *    basis_array,
int    num_basis,
const float *    atompos,
const int *    atom_basis,
const int *    num_shells_per_atom,
const int *    num_prim_per_shell,
const int *    shell_symmetry,
int    num_shells,
const int *    numvoxels,
float    voxelsize,
const float *    origin,
int    density,
float *    orbitalgrid
 

Definition at line 1067 of file OpenCLOrbital.C.

References orbthrparms::atom_basis, orbthrparms::atompos, orbthrparms::basis_array, orbthrparms::density, wkf_tasktile_struct::end, orbthrparms::num_basis, orbthrparms::num_prim_per_shell, orbthrparms::num_shells, orbthrparms::num_shells_per_atom, orbthrparms::num_wave_f, orbthrparms::numatoms, orbthrparms::numvoxels, openclorbitalthread, orbthrparms::orbh, orbthrparms::orbitalgrid, orbthrparms::origin, orbthrparms::shell_symmetry, wkf_tasktile_struct::start, orbthrparms::voxelsize, orbthrparms::wave_f, wkf_threadlaunch, wkf_threadpool_launch, and wkf_threadpool_sched_dynamic.

Referenced by Orbital::calculate_mo.


Variable Documentation

const char* clorbitalsrc
 

Definition at line 150 of file OpenCLOrbital.C.

Referenced by vmd_opencl_compile_orbital_pgm.


Generated on Tue Apr 23 04:24:36 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002