Skip to content

Commit eef836a

Browse files
committed
Rename variables that are not placeholder anymore
1 parent a2177f7 commit eef836a

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/sparse_blas/backends/cusparse/cusparse_task.hpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void submit_host_task(sycl::handler& cgh, sycl::queue& queue, Functor functor,
7979

8080
template <typename Functor, typename... CaptureOnlyAcc>
8181
void submit_host_task_with_acc(sycl::handler& cgh, sycl::queue& queue, Functor functor,
82-
sycl::accessor<std::uint8_t> workspace_placeholder_acc,
82+
sycl::accessor<std::uint8_t> workspace_acc,
8383
CaptureOnlyAcc... capture_only_accessors) {
8484
// Only capture the accessors to ensure the dependencies are properly
8585
// handled. The accessors's pointer have already been set to the native
@@ -88,12 +88,12 @@ void submit_host_task_with_acc(sycl::handler& cgh, sycl::queue& queue, Functor f
8888
// specification but should be true for all the implementations. This
8989
// assumption avoids the overhead of resetting the pointer of all data
9090
// handles for each enqueued command.
91-
cgh.host_task([functor, queue, workspace_placeholder_acc,
92-
capture_only_accessors...](sycl::interop_handle ih) {
93-
auto unused = std::make_tuple(capture_only_accessors...);
94-
(void)unused;
95-
functor(ih, workspace_placeholder_acc);
96-
});
91+
cgh.host_task(
92+
[functor, queue, workspace_acc, capture_only_accessors...](sycl::interop_handle ih) {
93+
auto unused = std::make_tuple(capture_only_accessors...);
94+
(void)unused;
95+
functor(ih, workspace_acc);
96+
});
9797
}
9898

9999
template <typename Functor, typename... CaptureOnlyAcc>
@@ -137,7 +137,7 @@ void submit_native_command_ext(sycl::handler& cgh, sycl::queue& queue, Functor f
137137
template <typename Functor, typename... CaptureOnlyAcc>
138138
void submit_native_command_ext_with_acc(sycl::handler& cgh, sycl::queue& queue, Functor functor,
139139
const std::vector<sycl::event>& dependencies,
140-
sycl::accessor<std::uint8_t> workspace_placeholder_acc,
140+
sycl::accessor<std::uint8_t> workspace_acc,
141141
CaptureOnlyAcc... capture_only_accessors) {
142142
// Only capture the accessors to ensure the dependencies are properly
143143
// handled. The accessors's pointer have already been set to the native
@@ -147,8 +147,7 @@ void submit_native_command_ext_with_acc(sycl::handler& cgh, sycl::queue& queue,
147147
// assumption avoids the overhead of resetting the pointer of all data
148148
// handles for each enqueued command.
149149
#ifdef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND
150-
cgh.ext_codeplay_enqueue_native_command([functor, queue, dependencies,
151-
workspace_placeholder_acc,
150+
cgh.ext_codeplay_enqueue_native_command([functor, queue, dependencies, workspace_acc,
152151
capture_only_accessors...](sycl::interop_handle ih) {
153152
auto unused = std::make_tuple(capture_only_accessors...);
154153
(void)unused;
@@ -166,22 +165,21 @@ void submit_native_command_ext_with_acc(sycl::handler& cgh, sycl::queue& queue,
166165
for (auto event : dependencies) {
167166
event.wait();
168167
}
169-
functor(ih, workspace_placeholder_acc);
168+
functor(ih, workspace_acc);
170169
});
171170
#else
172171
(void)dependencies;
173-
submit_host_task_with_acc(cgh, queue, functor, workspace_placeholder_acc,
174-
capture_only_accessors...);
172+
submit_host_task_with_acc(cgh, queue, functor, workspace_acc, capture_only_accessors...);
175173
#endif
176174
}
177175

178176
/// Helper submit functions to capture all accessors from the generic containers
179177
/// \p other_containers and ensure the dependencies of buffers are respected.
180178
/// The accessors are not directly used as the underlying data pointer has
181179
/// already been captured in previous functions.
182-
/// \p workspace_placeholder_acc is a placeholder accessor that will be bound to
183-
/// the cgh if not empty and given to the functor as a last argument.
184-
/// \p UseWorkspace must be true to use the placeholder accessor.
180+
/// \p workspace_buffer is an optional buffer. Its accessor will be given to the
181+
/// functor as a last argument if \p UseWorkspace is true.
182+
/// \p UseWorkspace must be true to use the given \p workspace_buffer.
185183
/// \p UseEnqueueNativeCommandExt controls whether host_task are used or the
186184
/// extension ext_codeplay_enqueue_native_command is used to launch tasks. The
187185
/// extension should only be used for asynchronous functions using native

0 commit comments

Comments
 (0)