diff --git a/src/inputCL.cpp b/src/inputCL.cpp index c3c30a2..b975b29 100644 --- a/src/inputCL.cpp +++ b/src/inputCL.cpp @@ -83,11 +83,11 @@ void InputCL::read_args( int argc, char *argv[] ) log( std::cout, " -e [FILE] (OR)\n" " --error-file [FILE]: Provide error file name\n" ); - log( - std::cout, - " --device-type [TYPE]: Kokkos device type to run ", - "with\n", - " (SERIAL, OPENMP, CUDA, HIP)" ); + log( std::cout, + " --device-type [TYPE]: Kokkos device type to run ", + "with\n", + " (SERIAL, PTHREAD, OPENMP, " + "CUDA, HIP)" ); log( std::cout, " --force-iteration [TYPE]: Specify iteration style for ", "force calculations\n", @@ -146,6 +146,8 @@ void InputCL::read_args( int argc, char *argv[] ) { if ( ( strcmp( argv[i + 1], "SERIAL" ) == 0 ) ) device_type = SERIAL; + else if ( ( strcmp( argv[i + 1], "PTHREAD" ) == 0 ) ) + device_type = PTHREAD; else if ( ( strcmp( argv[i + 1], "OPENMP" ) == 0 ) ) device_type = OPENMP; else if ( ( strcmp( argv[i + 1], "CUDA" ) == 0 ) ) diff --git a/src/mdfactory.h b/src/mdfactory.h index f8f91a0..7c81dff 100644 --- a/src/mdfactory.h +++ b/src/mdfactory.h @@ -117,6 +117,16 @@ class MDfactory #else throw std::runtime_error( "CabanaMD not compiled with Kokkos::Serial" ); +#endif + } + else if ( device == PTHREAD ) + { +#ifdef KOKKOS_ENABLE_THREADS + using t_device = Kokkos::Threads::device_type; + return createImpl( commandline ); +#else + throw std::runtime_error( + "CabanaMD not compiled with Kokkos::Threads" ); #endif } else if ( device == OPENMP ) diff --git a/src/types.h b/src/types.h index 3722871..9d46cf5 100644 --- a/src/types.h +++ b/src/types.h @@ -64,6 +64,7 @@ enum CUDA, HIP, OPENMP, + PTHREAD, SERIAL, DEFAULT };