Skip to content

Commit

Permalink
Update Readme to include Kokkos
Browse files Browse the repository at this point in the history
  • Loading branch information
tom91136 committed Jul 16, 2021
1 parent 99362eb commit 1af5b39
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ The top-level `makedeck` directory contains an input deck generation program and
Each other subdirectory contains a separate implementation:

- [OpenMP](openmp/) for CPUs
- [SYCL](sycl/) for CPUs
- [OpenMP target](openmp-target/) for GPUs
- [OpenCL](opencl/) for GPUs
- [CUDA](cuda/) for GPUs
- [OpenCL](opencl/) for GPUs
- [OpenACC](openacc/) for GPUs
- [SYCL](sycl/) for CPUs and GPUs
- [Kokkos](kokkos/) for CPUs and GPUs

## Building

To build with the default options, type `make` in an implementation directory.
There are options to choose the compiler used and the architecture targetted.
There are options to choose the compiler used and the architecture targeted.

Refer to each implementation's README for further build instructions.

Expand Down
2 changes: 1 addition & 1 deletion cuda/bude.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main(int argc, char *argv[])
// printf ("Maxdiff: %.2f (%.3f vs %.3f)\n", maxdiff, resultsRef[i], resultsCUDA[i]);
}

if (i < 8)
if (i < 1024)
printf("%7.2f vs %7.2f (%5.2f%%)\n", resultsRef[i], resultsCUDA[i], 100*diff);
}
printf("\nLargest difference was %.3f%%\n\n", maxdiff*100);
Expand Down
12 changes: 12 additions & 0 deletions cuda/bude_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ void runCUDA(float* results)
cudaDeviceSynchronize();

double start = getTimestamp();
printf("<<%d,%d>> -> %d\n",global, local,params.nposes);


for(int ii = 0; ii < params.iterations; ++ii)
{
Expand Down Expand Up @@ -133,10 +135,12 @@ __device__ void compute_transformation_matrix(const float transform_0,
transform[0].y = sx*sy*cz - cx*sz;
transform[0].z = cx*sy*cz + sx*sz;
transform[0].w = transform_3;

transform[1].x = cy*sz;
transform[1].y = sx*sy*sz + cx*cz;
transform[1].z = cx*sy*sz - sx*cz;
transform[1].w = transform_4;

transform[2].x = -sy;
transform[2].y = sx*cy;
transform[2].z = cx*cy;
Expand Down Expand Up @@ -191,12 +195,18 @@ __global__ void fasten_main(const int natlig,
transforms_5[index],
transform[i]);
etot[i] = ZERO;
// etotals[ix] = transform[i][0].x;
}

#ifdef USE_SHARED
__syncthreads();
#endif

// etotals[ix] = ix ;// transform[3][1].y; // (transforms_0[ix + 1 * lsz]) ;// transform[0][0].x ;// transform[0][0].x;
// etot[1] = transforms_1[0] ;// transform[0][0].y;
// etot[2] = transforms_2[0] ;// transform[0][0].z;
// etot[3] = transforms_3[0] ;// transform[0][0].w;

// Loop over ligand atoms
int il = 0;
do
Expand All @@ -221,6 +231,7 @@ __global__ void fasten_main(const int natlig,
linitpos.y*transform[i][2].y + linitpos.z*transform[i][2].z;
}


// Loop over protein atoms
int ip = 0;
do
Expand Down Expand Up @@ -290,6 +301,7 @@ __global__ void fasten_main(const int natlig,
etotals[td_base+i*blockDim.x] = etot[i]*HALF;
}
}
// etotals[ix] = transform[0][0].x;
} //end of fasten_main


Expand Down
2 changes: 1 addition & 1 deletion kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

project(bude_kokkos)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
2 changes: 1 addition & 1 deletion kokkos/src/bude.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#endif

#ifndef WG_SIZE
#define WG_SIZE 128
#define WG_SIZE 256
#endif

#define DEFAULT_ITERS 8
Expand Down

0 comments on commit 1af5b39

Please sign in to comment.