diff --git a/lib/gpu/Opencl.makefile b/lib/gpu/Opencl.makefile index 3f08380323..203e04de1a 100644 --- a/lib/gpu/Opencl.makefile +++ b/lib/gpu/Opencl.makefile @@ -1,4 +1,4 @@ -OCL = $(OCL_CPP) $(OCL_PREC) -DUSE_OPENCL +OCL = $(OCL_CPP) $(OCL_PREC) $(OCL_TUNE) -DUSE_OPENCL OCL_LIB = $(LIB_DIR)/libgpu.a # Headers for Geryon UCL_H = $(wildcard ./geryon/ucl*.h) diff --git a/lib/gpu/lal_cg_cmm.cpp b/lib/gpu/lal_cg_cmm.cpp index 0742bc8230..7b798cc446 100644 --- a/lib/gpu/lal_cg_cmm.cpp +++ b/lib/gpu/lal_cg_cmm.cpp @@ -3,7 +3,7 @@ ------------------- W. Michael Brown (ORNL) - Class for acceleration of the cg/cmm/cut pair style + Class for acceleration of the lj/sdk/cut pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_cg_cmm.cu b/lib/gpu/lal_cg_cmm.cu index 90c7376be3..46d1cbab50 100644 --- a/lib/gpu/lal_cg_cmm.cu +++ b/lib/gpu/lal_cg_cmm.cu @@ -3,7 +3,7 @@ // ------------------- // W. Michael Brown (ORNL) // -// Device code for acceleration of the cg/cmm/cut pair style +// Device code for acceleration of the lj/sdk pair style // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_cg_cmm.h b/lib/gpu/lal_cg_cmm.h index c7d50b0b04..394cd81254 100644 --- a/lib/gpu/lal_cg_cmm.h +++ b/lib/gpu/lal_cg_cmm.h @@ -3,7 +3,7 @@ ------------------- W. Michael Brown (ORNL) - Class for acceleration of the cg/cmm/cut pair style + Class for acceleration of the lj/sdk pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_cg_cmm_ext.cpp b/lib/gpu/lal_cg_cmm_ext.cpp index c9fafb789e..6d64c30435 100644 --- a/lib/gpu/lal_cg_cmm_ext.cpp +++ b/lib/gpu/lal_cg_cmm_ext.cpp @@ -3,7 +3,7 @@ ------------------- W. Michael Brown (ORNL) - Functions for LAMMPS access to cg/cmm/cut pair acceleration routines + Functions for LAMMPS access to lj/sdk pair acceleration routines __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -42,7 +42,7 @@ int cmm_gpu_init(const int ntypes, double **cutsq, int **cg_types, int gpu_rank=CMMMF.device->gpu_rank(); int procs_per_gpu=CMMMF.device->procs_per_gpu(); - CMMMF.device->init_message(screen,"cg/cmm",first_gpu,last_gpu); + CMMMF.device->init_message(screen,"lj/sdk",first_gpu,last_gpu); bool message=false; if (CMMMF.device->replica_me()==0 && screen) diff --git a/lib/gpu/lal_cg_cmm_long.cpp b/lib/gpu/lal_cg_cmm_long.cpp index ffda7343c0..2c12125b52 100644 --- a/lib/gpu/lal_cg_cmm_long.cpp +++ b/lib/gpu/lal_cg_cmm_long.cpp @@ -3,7 +3,7 @@ ------------------- W. Michael Brown (ORNL) - Class for acceleration of the cg/cmm/coul/long pair style + Class for acceleration of the lj/sdk/coul/long pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_cg_cmm_long.cu b/lib/gpu/lal_cg_cmm_long.cu index 45dbf2a865..b0db9d2aa3 100644 --- a/lib/gpu/lal_cg_cmm_long.cu +++ b/lib/gpu/lal_cg_cmm_long.cu @@ -3,7 +3,7 @@ // ------------------- // W. Michael Brown (ORNL) // -// Device code for acceleration of the cg/cmm/coul/long pair style +// Device code for acceleration of the lj/sdk/coul/long pair style // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_cg_cmm_long.h b/lib/gpu/lal_cg_cmm_long.h index 1ffbc7c5ba..bde5c79c74 100644 --- a/lib/gpu/lal_cg_cmm_long.h +++ b/lib/gpu/lal_cg_cmm_long.h @@ -3,7 +3,7 @@ ------------------- W. Michael Brown (ORNL) - Class for acceleration of the cg/cmm/coul/long pair style + Class for acceleration of the lj/sdk/coul/long pair style __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) diff --git a/lib/gpu/lal_cg_cmm_long_ext.cpp b/lib/gpu/lal_cg_cmm_long_ext.cpp index 8da2d65afb..ca7aab70ce 100644 --- a/lib/gpu/lal_cg_cmm_long_ext.cpp +++ b/lib/gpu/lal_cg_cmm_long_ext.cpp @@ -3,7 +3,7 @@ ------------------- W. Michael Brown (ORNL) - Functions for LAMMPS access to cg/cmm/coul/long acceleration functions + Functions for LAMMPS access to lj/sdk/coul/long acceleration functions __________________________________________________________________________ This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) @@ -44,7 +44,7 @@ int cmml_gpu_init(const int ntypes, double **cutsq, int **cg_type, int gpu_rank=CMMLMF.device->gpu_rank(); int procs_per_gpu=CMMLMF.device->procs_per_gpu(); - CMMLMF.device->init_message(screen,"cg/cmm/coul/long",first_gpu,last_gpu); + CMMLMF.device->init_message(screen,"lj/sdk/coul/long",first_gpu,last_gpu); bool message=false; if (CMMLMF.device->replica_me()==0 && screen) diff --git a/lib/gpu/lal_precision.h b/lib/gpu/lal_precision.h index 2ba5445426..c9ef2b41f7 100644 --- a/lib/gpu/lal_precision.h +++ b/lib/gpu/lal_precision.h @@ -84,10 +84,17 @@ inline std::ostream & operator<<(std::ostream &out, const _lgpu_double4 &v) { enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; +// OCL_VENDOR: preprocessor define for hardware +// specific sizes of OpenCL kernel related constants + #ifdef FERMI_OCL #define OCL_VENDOR "FERMI_OCL" #endif +#ifdef CYPRESS_OCL +#define OCL_VENDOR "CYPRESS_OCL" +#endif + #ifndef OCL_VENDOR #define OCL_VENDOR "GENERIC_OCL" #endif diff --git a/lib/gpu/lal_preprocessor.h b/lib/gpu/lal_preprocessor.h index 28734b3439..950ccd933c 100644 --- a/lib/gpu/lal_preprocessor.h +++ b/lib/gpu/lal_preprocessor.h @@ -175,7 +175,7 @@ typedef struct _double4 double4; #endif // ------------------------------------------------------------------------- -// FERMI OPENCL DEFINITIONS +// NVIDIA FERMI OPENCL DEFINITIONS // ------------------------------------------------------------------------- #ifdef FERMI_OCL @@ -202,6 +202,34 @@ typedef struct _double4 double4; #endif +// ------------------------------------------------------------------------- +// AMD CYPRESS OPENCL DEFINITIONS +// ------------------------------------------------------------------------- + +#ifdef CYPRESS_OCL + +#define USE_OPENCL +#define fast_mul(X,Y) (X)*(Y) +#define ARCH 0 +#define DRIVER 0 +#define MEM_THREADS 32 +#define THREADS_PER_ATOM 4 +#define THREADS_PER_CHARGE 8 +#define BLOCK_PAIR 128 +#define MAX_SHARED_TYPES 8 +#define BLOCK_NBOR_BUILD 64 +#define BLOCK_BIO_PAIR 64 + +#define WARP_SIZE 64 +#define PPPM_BLOCK_1D 64 +#define BLOCK_CELL_2D 8 +#define BLOCK_CELL_ID 128 +#define MAX_BIO_SHARED_TYPES 128 + +#pragma OPENCL EXTENSION cl_khr_fp64: enable + +#endif + // ------------------------------------------------------------------------- // GENERIC OPENCL DEFINITIONS // -------------------------------------------------------------------------