small tweaks

This commit is contained in:
Axel Kohlmeyer
2021-09-17 16:51:37 -04:00
parent 3046c9ca93
commit e6fb0e3bd8
3 changed files with 5 additions and 5 deletions

View File

@ -348,7 +348,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
} }
template <class numtyp, class acctyp> template <class numtyp, class acctyp>
int DeviceT::set_ocl_params(std::string s_config, std::string extra_args) { int DeviceT::set_ocl_params(std::string s_config, const std::string &extra_args) {
#ifdef USE_OPENCL #ifdef USE_OPENCL
#include "lal_pre_ocl_config.h" #include "lal_pre_ocl_config.h"
@ -368,7 +368,7 @@ int DeviceT::set_ocl_params(std::string s_config, std::string extra_args) {
int token_count=0; int token_count=0;
std::string params[18]; std::string params[18];
char ocl_config[2048]; char ocl_config[2048];
strcpy(ocl_config,s_config.c_str()); strncpy(ocl_config,s_config.c_str(),2047);
char *pch = strtok(ocl_config,","); char *pch = strtok(ocl_config,",");
_ocl_config_name=pch; _ocl_config_name=pch;
pch = strtok(nullptr,","); pch = strtok(nullptr,",");

View File

@ -348,7 +348,7 @@ class Device {
int _data_in_estimate, _data_out_estimate; int _data_in_estimate, _data_out_estimate;
std::string _ocl_config_name, _ocl_config_string, _ocl_compile_string; std::string _ocl_config_name, _ocl_config_string, _ocl_compile_string;
int set_ocl_params(std::string, std::string); int set_ocl_params(std::string, const std::string &);
}; };
} }

View File

@ -390,7 +390,7 @@ void PairLJLongTIP4PLongOMP::compute_inner()
loop_setup_thr(ifrom, ito, tid, inum, nthreads); loop_setup_thr(ifrom, ito, tid, inum, nthreads);
ThrData *thr = fix->get_thr(tid); ThrData *thr = fix->get_thr(tid);
thr->timer(Timer::START); thr->timer(Timer::START);
ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); ev_setup_thr(0, 0, nall, nullptr, nullptr, nullptr, thr);
eval_inner(ifrom, ito, thr); eval_inner(ifrom, ito, thr);
thr->timer(Timer::PAIR); thr->timer(Timer::PAIR);
@ -415,7 +415,7 @@ void PairLJLongTIP4PLongOMP::compute_middle()
loop_setup_thr(ifrom, ito, tid, inum, nthreads); loop_setup_thr(ifrom, ito, tid, inum, nthreads);
ThrData *thr = fix->get_thr(tid); ThrData *thr = fix->get_thr(tid);
thr->timer(Timer::START); thr->timer(Timer::START);
ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); ev_setup_thr(0, 0, nall, nullptr, nullptr, nullptr, thr);
eval_middle(ifrom, ito, thr); eval_middle(ifrom, ito, thr);
thr->timer(Timer::PAIR); thr->timer(Timer::PAIR);