Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
35e3127
set all static const values to static constexpr so that -O0 level opt…
SteveBronder Oct 20, 2022
dbe2429
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Oct 20, 2022
ca0ca56
change static const strings to static constexpr const char*
SteveBronder Oct 20, 2022
9c35e89
change static const strings to static constexpr const char*
SteveBronder Oct 20, 2022
8d95623
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Oct 20, 2022
f200221
update
SteveBronder Oct 20, 2022
dbf86a0
Merge branch 'fix/constexpr-constants' of github.com:stan-dev/math in…
SteveBronder Oct 20, 2022
f6b5c52
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Oct 20, 2022
b8f8a60
Fix namespace for bool_constant
SteveBronder Oct 20, 2022
04c1c98
Fix namespace for bool_constant
SteveBronder Oct 20, 2022
9f2af5a
Merge commit '4d2b936d6686586376bbc8a99ecdf7c0937c251f' into HEAD
yashikno Oct 20, 2022
e21588e
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Oct 20, 2022
265f0cf
remove constexpr from opencl double_d type
SteveBronder Oct 20, 2022
9af3659
cpplint fixes
SteveBronder Oct 20, 2022
ca927a1
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Oct 20, 2022
0bc2be0
fix weiner_lpdf
SteveBronder Oct 21, 2022
1d2d4aa
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Oct 21, 2022
67d3781
header fix for hypergeometric_2F1
SteveBronder Oct 25, 2022
9a12c77
Merge branch 'fix/constexpr-constants' of github.com:stan-dev/math in…
SteveBronder Oct 25, 2022
fa56ba8
fix index_rev missing }
SteveBronder Nov 3, 2022
7fbffe0
Merge commit 'f4c68170c1f1e9bc1284520560204ea9e76c62cd' into HEAD
yashikno Nov 3, 2022
184978f
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Nov 3, 2022
88c4211
ignore whitespace cpplint for opencl kernel
SteveBronder Nov 3, 2022
1a9b1c1
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Nov 3, 2022
bef2174
Merge remote-tracking branch 'upstream/develop' into fix/constexpr-co…
andrjohns Dec 2, 2022
7ea0296
Merge branch 'develop' into fix/constexpr-constants
andrjohns May 26, 2023
8779172
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot May 26, 2023
7f2b34e
Missed cpplint in merge
andrjohns May 26, 2023
5ca9e19
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot May 26, 2023
1e503a4
merge to develop
SteveBronder Jul 20, 2023
12597ce
update with simplifications for constant values
SteveBronder Jul 20, 2023
10514e1
Merge remote-tracking branch 'origin/develop' into fix/constexpr-cons…
SteveBronder Jul 20, 2023
a16df24
merge conflict
SteveBronder Jul 20, 2023
092c0be
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Jul 20, 2023
e9cf9cf
update headers
SteveBronder Jul 20, 2023
b527a01
Merge branch 'develop' into fix/constexpr-constants
andrjohns Sep 19, 2023
ef5fbdc
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Sep 19, 2023
d2d4cee
Fix header tests
andrjohns Sep 19, 2023
b634978
Fix merge breakage
andrjohns Sep 19, 2023
5be6653
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Sep 19, 2023
57cc140
Update char * to char*
andrjohns Sep 19, 2023
87245ad
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Sep 19, 2023
c7dd4fd
Cpplint
andrjohns Sep 19, 2023
1cf8c04
Merge branch 'develop' into fix/constexpr-constants
andrjohns Feb 15, 2024
952ea3a
const char* updates
andrjohns Feb 15, 2024
f365972
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
stan-buildbot Feb 15, 2024
e9987b6
Temporarily disable problematic test
andrjohns Feb 16, 2024
44dd969
Revert use of Boost's constants for LOG_PI
andrjohns Feb 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion stan/math/opencl/double_d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ inline double_d mul_d_d(double a, double b) {
}

// \cond
static const char* double_d_src = STRINGIFY(
static constexpr const char* double_d_src = STRINGIFY(
// \endcond
typedef struct {
double high;
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernel_generator/colwise_reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class colwise_reduction
using Scalar = typename std::remove_reference_t<T>::Scalar;
using base = operation_cl<Derived, Scalar, T>;
using base::var_name_;
static const bool require_specific_local_size = true;
static constexpr bool require_specific_local_size = true;

protected:
std::string init_;
Expand Down
17 changes: 10 additions & 7 deletions stan/math/opencl/kernel_generator/multi_result_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct multi_result_kernel_internal {
next::check_assign_dimensions(n_rows, n_cols, assignment_pairs);
const auto& expression = std::get<N>(assignment_pairs).second;
const auto& result = std::get<N>(assignment_pairs).first;
const char* function = "results.operator=";
constexpr const char* function = "results.operator=";

int expression_rows = expression.rows();
int expression_cols = expression.cols();
Expand Down Expand Up @@ -437,8 +437,9 @@ class results_cl {
using impl = typename internal::multi_result_kernel_internal<
std::tuple_size<std::tuple<T_expressions...>>::value - 1,
T_res...>::template inner<T_expressions...>;
static const bool require_specific_local_size = std::max(
{std::decay_t<T_expressions>::Deriv::require_specific_local_size...});
static constexpr bool require_specific_local_size
= stan::math::disjunction<stan::bool_constant<std::decay_t<
T_expressions>::Deriv::require_specific_local_size>...>::value;

name_generator ng;
std::unordered_map<const void*, const char*> generated;
Expand Down Expand Up @@ -503,14 +504,16 @@ class results_cl {
std::tuple_size<std::tuple<T_expressions...>>::value - 1,
T_res...>::template inner<T_expressions...>;

static const bool any_output = std::max(
{false, !is_without_output<std::decay_t<T_expressions>>::value...});
static constexpr bool any_output
= stan::math::disjunction<stan::bool_constant<
!is_without_output<std::decay_t<T_expressions>>::value>...>::value;
if (!any_output) {
return;
}

static const bool require_specific_local_size = std::max(
{std::decay_t<T_expressions>::Deriv::require_specific_local_size...});
static constexpr bool require_specific_local_size
= stan::math::disjunction<stan::bool_constant<std::decay_t<
T_expressions>::Deriv::require_specific_local_size>...>::value;

int n_rows = std::get<0>(assignment_pairs).second.thread_rows();
int n_cols = std::get<0>(assignment_pairs).second.thread_cols();
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernel_generator/operation_cl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class operation_cl : public operation_cl_base {
static constexpr int N = sizeof...(Args);
using view_transitivity = std::tuple<std::is_same<Args, void>...>;
// value representing a not yet determined size
static const int dynamic = -1;
static constexpr int dynamic = -1;

/**
Returns an argument to this operation
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernel_generator/reduction_2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class reduction_2d
using Scalar = typename std::remove_reference_t<T>::Scalar;
using base = operation_cl<Derived, Scalar, T>;
using base::var_name_;
static const bool require_specific_local_size = true;
static constexpr bool require_specific_local_size = true;

protected:
std::string init_;
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/add.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const std::string add_batch_kernel_code = STRINGIFY(
static constexpr const char *add_batch_kernel_code = STRINGIFY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static constexpr const char *add_batch_kernel_code = STRINGIFY(
static constexpr const char* add_batch_kernel_code = STRINGIFY(

For consistency

// \endcond
/** \ingroup opencl_kernels
* Sums a batch of matrices. Buffer A contains
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/batch_identity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const std::string batch_identity_kernel_code = STRINGIFY(
static constexpr const char* batch_identity_kernel_code = STRINGIFY(
// \endcond

/** \ingroup opencl_kernels
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/categorical_logit_glm_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const std::string categorical_logit_glm_kernel_code = STRINGIFY(
static constexpr const char* categorical_logit_glm_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* GPU implementation of Generalized Linear Model (GLM)
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/check_symmetric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const std::string is_symmetric_kernel_code = STRINGIFY(
static constexpr const char *is_symmetric_kernel_code = STRINGIFY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static constexpr const char *is_symmetric_kernel_code = STRINGIFY(
static constexpr const char* is_symmetric_kernel_code = STRINGIFY(

// \endcond
/** \ingroup opencl_kernels
* Check if the <code>matrix_cl</code> is symmetric
Expand Down
4 changes: 2 additions & 2 deletions stan/math/opencl/kernels/cholesky_decompose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const std::string cholesky_decompose_kernel_code = STRINGIFY(
static constexpr const char* cholesky_decompose_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Calculates the Cholesky Decomposition of a matrix on an OpenCL
Expand All @@ -30,7 +30,7 @@ static const std::string cholesky_decompose_kernel_code = STRINGIFY(
* This kernel uses the helper macros available in helpers.cl.
*
*/
__kernel void cholesky_decompose(__global double *A, int rows) {
__kernel void cholesky_decompose(__global double* A, int rows) {
const int local_index = get_local_id(0);
// The following code is the sequential version of the inplace
// cholesky decomposition. Only the innermost loops are parallelized. The
Expand Down
6 changes: 3 additions & 3 deletions stan/math/opencl/kernels/cumulative_sum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char *cumulative_sum1_kernel_code = STRINGIFY(
static constexpr const char *cumulative_sum1_kernel_code = STRINGIFY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static constexpr const char *cumulative_sum1_kernel_code = STRINGIFY(
static constexpr const char* cumulative_sum1_kernel_code = STRINGIFY(

// \endcond
/** \ingroup opencl_kernels
* First kernel of the cumulative sum implementation. Each thread sums the
Expand Down Expand Up @@ -62,7 +62,7 @@ static const char *cumulative_sum1_kernel_code = STRINGIFY(
// \endcond

// \cond
static const char *cumulative_sum2_kernel_code = STRINGIFY(
static constexpr const char *cumulative_sum2_kernel_code = STRINGIFY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static constexpr const char *cumulative_sum2_kernel_code = STRINGIFY(
static constexpr const char* cumulative_sum2_kernel_code = STRINGIFY(

// \endcond
/** \ingroup opencl_kernels
* Second kernel of the cumulative sum implementation. Calculates prefix sum
Expand Down Expand Up @@ -116,7 +116,7 @@ static const char *cumulative_sum2_kernel_code = STRINGIFY(
// \endcond

// \cond
static const char *cumulative_sum3_kernel_code = STRINGIFY(
static constexpr const char *cumulative_sum3_kernel_code = STRINGIFY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static constexpr const char *cumulative_sum3_kernel_code = STRINGIFY(
static constexpr const char* cumulative_sum3_kernel_code = STRINGIFY(

// \endcond
/** \ingroup opencl_kernels
* Third kernel of the cumulative sum implementation. Given sums of threads
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/Phi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char* phi_device_function
static constexpr const char* phi_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/Phi_approx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char* phi_approx_device_function
static constexpr const char* phi_approx_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_PHI_APPROX\n"
"#define "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char *atomic_add_double_device_function
static constexpr const char *atomic_add_double_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_ATOMIC_ADD_DOUBLE\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_ATOMIC_ADD_DOUBLE\n"
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/beta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char* beta_device_function
static constexpr const char* beta_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_BETA\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_BETA\n" STRINGIFY(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* binomial_coefficient_log_device_function
static constexpr const char* binomial_coefficient_log_device_function
= "\n"
"#ifndef "
"STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_BINOMIAL_COEFFICIENT_LOG\n"
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/digamma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char* digamma_device_function
static constexpr const char* digamma_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_DIGAMMA\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_DIGAMMA\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/inv_Phi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char* inv_phi_device_function
static constexpr const char* inv_phi_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_PHI\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_PHI\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/inv_logit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* inv_logit_device_function
static constexpr const char* inv_logit_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_LOGIT\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_LOGIT\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/inv_square.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* inv_square_device_function
static constexpr const char* inv_square_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_INV_SQUARE\n"
"#define "
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/lbeta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* lbeta_device_function
static constexpr const char* lbeta_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LBETA\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LBETA\n" STRINGIFY(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* lgamma_stirling_device_function
static constexpr const char* lgamma_stirling_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING\n"
"#define "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* lgamma_stirling_diff_device_function
static constexpr const char* lgamma_stirling_diff_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING_DIFF\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LGAMMA_STIRLING_DIFF\n"
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/lmultiply.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* lmultiply_device_function
static constexpr const char* lmultiply_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LMULTIPLY\n"
"#define "
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/log1m.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log1m_device_function
static constexpr const char* log1m_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1M\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1M\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/log1m_exp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log1m_exp_device_function
static constexpr const char* log1m_exp_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1M_EXP\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1M_EXP\n" STRINGIFY(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log1m_inv_logit_device_function
static constexpr const char* log1m_inv_logit_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1M_INV_LOGIT\n"
"#define "
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/log1p_exp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log1p_exp_device_function
static constexpr const char* log1p_exp_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1P_EXP\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG1P_EXP\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/log_diff_exp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log_diff_exp_device_function
static constexpr const char* log_diff_exp_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG_DIFF_EXP\n"
"#define "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log_inv_logit_device_function
static constexpr const char* log_inv_logit_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG_INV_LOGIT\n"
"#define "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* log_inv_logit_diff_device_function
static constexpr const char* log_inv_logit_diff_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOG_INV_LOGIT_DIFF\n"
"#define "
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/logit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* logit_device_function
static constexpr const char* logit_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOGIT\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_LOGIT\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/multiply_log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace math {
namespace opencl_kernels {

// \cond
static const char* multiply_log_device_function
static constexpr const char* multiply_log_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_MULTIPLY_LOG\n"
"#define "
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/device_functions/trigamma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const char* trigamma_device_function
static constexpr const char* trigamma_device_function
= "\n"
"#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_TRIGAMMA\n"
"#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_TRIGAMMA\n" STRINGIFY(
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/diag_inv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const std::string diag_inv_kernel_code = STRINGIFY(
static constexpr const char* diag_inv_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Calculates inplace submatrix inversions along the matrix diagonal.
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/divide_columns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const std::string divide_columns_kernel_code = STRINGIFY(
static constexpr const char *divide_columns_kernel_code = STRINGIFY(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static constexpr const char *divide_columns_kernel_code = STRINGIFY(
static constexpr const char* divide_columns_kernel_code = STRINGIFY(

// \endcond
/** \ingroup opencl_kernels
* Takes vector A and divides columns vector in A element-wise by the values
Expand Down
2 changes: 1 addition & 1 deletion stan/math/opencl/kernels/fill_strict_tri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace stan {
namespace math {
namespace opencl_kernels {
// \cond
static const std::string fill_strict_tri_kernel_code = STRINGIFY(
static constexpr const char* fill_strict_tri_kernel_code = STRINGIFY(
// \endcond
/** \ingroup opencl_kernels
* Stores constant in the triangular part of a matrix
Expand Down
Loading