Skip to content

Commit

Permalink
add std:: to sqrt for getting max worker size and inline commandQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Jan 16, 2018
1 parent 5432c81 commit 26b7cbb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stan/math/prim/mat/fun/ocl_gpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace stan {

size_t max_workgroup_size;

void init() {
inline void init() {
try {
std::vector<cl::Platform> allPlatforms;
cl::Platform::get(&allPlatforms);
Expand Down Expand Up @@ -167,29 +167,29 @@ namespace stan {
}

public:
std::string description() const {
inline std::string description() const {
if (initialized_ == 1) {
return description_;
}
return "No device selected yet.";
}

cl::Context& context() {
inline cl::Context& context() {
if (initialized_ == 0) {
init();
initialized_ = 1;
}
return oclContext_;
}

cl::CommandQueue& queue() {
inline cl::CommandQueue& queue() {
if (initialized_ == 0) {
init();
initialized_ = 1;
}
return oclQueue_;
}
int maxWorkgroupSize(){
inline int maxWorkgroupSize(){
return max_workgroup_size;
}
};
Expand Down Expand Up @@ -253,7 +253,7 @@ namespace stan {
try {
char temp[100];
int local = 32;
int gpu_local_max = sqrt(get_maximum_workgroup_size());
int gpu_local_max = std::sqrt(get_maximum_workgroup_size());
if (gpu_local_max < local)
local = gpu_local_max;
// parameters that have special limits are for now handled here
Expand Down

0 comments on commit 26b7cbb

Please sign in to comment.