Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francesco Brarda
stan-math-petsc
Commits
e5de8111
Commit
e5de8111
authored
6 years ago
by
rok-cesnovar
Browse files
Options
Download
Email Patches
Plain Diff
macros test
parent
1e5f13e3
stan-petsc
bugfix/1063-std-lgamma
bugfix/1152-algebra_solver-lambdas
bugfix/issue-1250-lgamma
bugfix/issue-1270-add-check-for-meta-includes
bugfix/issue-2708-map-rect-fail
build/config-device-id
code-cleanup/chain-final
code-cleanup/issue-937-flatten
develop
feature/1258-ad-test-core
feature/adjoint-ode
feature/automatic-autodiff-testing
feature/concept-chainable-allocator
feature/daniel-windows
feature/eigen-aligned-malloc
feature/faster-ad-tls
feature/faster-ad-tls-v2
feature/faster-ad-tls-v3
feature/faster-ad-tls-v4
feature/faster-ad-tls-v4-windows
feature/faster-ad-tls-v6
feature/intel-tbb-lib
feature/issue-1012-binorm-copula-cdf
feature/issue-1022-integrate-1d-templating
feature/issue-1115-newton_solver
feature/issue-123-complex
feature/issue-1257-diff_algebra_solver
feature/issue-38-multi_normal_sufficient
feature/issue-755-laplace
feature/issue-838-linseq
feature/issue-937-flatten-meta-again
feature/issue-937-flatten-meta-the-third
feature/issue-937-flatten-meta-third
feature/issue-962-bivar-norm
feature/issue-989-rev-mat-eig
feature/lambertw
feature/map_rect-cpp17
feature/map_rect-fail-windows
feature/matrix_sqrt
feature/openMP
feature/operands_partials_less_copies
feature/parallel_for_each
feature/python-test-math-dependencies
feature/refactor-nested
feature/sparse-cholesky
gpu_matrix_multiply
gpu_performance_tests
internal/no-assert
issue-static-init-order
kcl
master
mpi_errors
parallel-ad-tape-3
perf/operands_and_partials_deux
perf/runtime_matrix_check_flags
release/v2.19.0
release/v2.19.1
release/v2.20.0
seantest/faster-ad-tls-v3
stancon/syclik
syclik/forward-mode
v2.20.0
v2.19.1
v2.19.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stan/math/gpu/kernel_cl.hpp
+4
-0
stan/math/gpu/kernel_cl.hpp
stan/math/gpu/kernels/add_matrix_kernel.cl
+1
-10
stan/math/gpu/kernels/add_matrix_kernel.cl
with
5 additions
and
10 deletions
+5
-10
stan/math/gpu/kernel_cl.hpp
View file @
e5de8111
...
...
@@ -139,6 +139,10 @@ class kernel_cl {
+
std
::
to_string
(
this
->
base_options
()[
comp_opts
]);
}
}
kernel_opts
+=
std
::
string
(
" -DA(i,j)=A[j*rows+i]"
);
kernel_opts
+=
std
::
string
(
" -DB(i,j)=B[j*rows+i]"
);
kernel_opts
+=
std
::
string
(
" -DC(i,j)=C[j*rows+i]"
);
try
{
cl
::
Program
::
Sources
source
(
1
,
...
...
This diff is collapsed.
Click to expand it.
stan/math/gpu/kernels/add_matrix_kernel.cl
View file @
e5de8111
#
define
STRINGIFY
(
src
)
#
src
STRINGIFY
(
//#ifndef
A
//#define
A
(
i,
j
)
A[j
*
rows
+
i]
//#endif
//#ifndef
B
//#define
B
(
i,
j
)
B[j
*
rows
+
i]
//#endif
//#ifndef
C
//#define
C
(
i,
j
)
C[j
*
rows
+
i]
//#endif
/**
*
Matrix
addition
on
the
GPU
*
...
...
@@ -25,7 +16,7 @@ __kernel void add(__global double *C, __global double *A, __global double *B,
int
i
=
get_global_id
(
0
)
;
int
j
=
get_global_id
(
1
)
;
if
(
i
<
rows
&&
j
<
cols
)
{
C
[j
*
rows
+
i]
=
A[j
*
rows
+
i]
+
B[j
*
rows
+
i]
;
C
(
i,
j
)
=
A
(
i,
j
)
+
B
(
i,
j
)
;
}
}
)
;
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help