@@ -161,7 +161,7 @@ class opencl_context_base {
161161 // the device
162162 bool in_order_; // Whether to use out of order execution.
163163 // Holds Default parameter values for each Kernel.
164- using map_base_opts = std::map <std::string, int >;
164+ using map_base_opts = std::unordered_map <std::string, int >;
165165 map_base_opts base_opts_
166166 = {{" LOWER" , static_cast <int >(matrix_cl_view::Lower)},
167167 {" UPPER" , static_cast <int >(matrix_cl_view::Upper)},
@@ -194,7 +194,7 @@ class opencl_context_base {
194194 } tuning_opts_;
195195
196196 protected:
197- static opencl_context_base& getInstance () {
197+ static opencl_context_base& getInstance () noexcept {
198198 static opencl_context_base instance_;
199199 return instance_;
200200 }
@@ -352,21 +352,21 @@ class opencl_context {
352352 * objects. For stan, there should only be one context, queue, device, and
353353 * program with multiple kernels.
354354 */
355- inline cl::Context& context () {
355+ inline cl::Context& context () noexcept {
356356 return opencl_context_base::getInstance ().context_ ;
357357 }
358358 /* * \ingroup opencl_context_group
359359 * Returns the reference to the active OpenCL command queue for the device.
360360 * One command queue will exist per device where
361361 * kernels are placed on the command queue and by default executed in order.
362362 */
363- inline cl::CommandQueue& queue () {
363+ inline cl::CommandQueue& queue () noexcept {
364364 return opencl_context_base::getInstance ().command_queue_ ;
365365 }
366366 /* * \ingroup opencl_context_group
367367 * Returns a copy of the map of kernel defines
368368 */
369- inline opencl_context_base::map_base_opts& base_opts () {
369+ inline opencl_context_base::map_base_opts& base_opts () noexcept {
370370 return opencl_context_base::getInstance ().base_opts_ ;
371371 }
372372 /* * \ingroup opencl_context_group
@@ -376,35 +376,35 @@ class opencl_context {
376376 * max workgroup of 256 would allow thread blocks of sizes (16,16), (128,2),
377377 * (8, 32), etc.
378378 */
379- inline int max_thread_block_size () {
379+ inline int max_thread_block_size () noexcept {
380380 return opencl_context_base::getInstance ().max_thread_block_size_ ;
381381 }
382382
383383 /* * \ingroup opencl_context_group
384384 * Returns the thread block size for the Cholesky Decompositions L_11.
385385 */
386- inline opencl_context_base::tuning_struct& tuning_opts () {
386+ inline opencl_context_base::tuning_struct& tuning_opts () noexcept {
387387 return opencl_context_base::getInstance ().tuning_opts_ ;
388388 }
389389
390390 /* * \ingroup opencl_context_group
391391 * Returns a vector containing the OpenCL device used to create the context
392392 */
393- inline std::vector<cl::Device>& device () {
393+ inline std::vector<cl::Device>& device () noexcept {
394394 return opencl_context_base::getInstance ().device_ ;
395395 }
396396
397397 /* * \ingroup opencl_context_group
398398 * Returns a vector containing the OpenCL platform used to create the context
399399 */
400- inline std::vector<cl::Platform>& platform () {
400+ inline std::vector<cl::Platform>& platform () noexcept {
401401 return opencl_context_base::getInstance ().platform_ ;
402402 }
403403 /* * \ingroup opencl_context_group
404404 * Return a bool representing whether the write to the OpenCL device are
405405 * blocking
406406 */
407- inline bool & in_order () {
407+ inline bool & in_order () noexcept {
408408 return opencl_context_base::getInstance ().in_order_ ;
409409 }
410410
0 commit comments