Skip to content

Commit aa5713d

Browse files
committed
linting and tidying
1 parent 2ed0261 commit aa5713d

23 files changed

Lines changed: 68 additions & 72 deletions

examples/nvexec/maxwell/snr.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ STDEXEC_PRAGMA_IGNORE_GNU("-Wmissing-braces")
5757
namespace ex = stdexec;
5858

5959
#if defined(_NVHPC_CUDA) || defined(__CUDACC__)
60-
//
6160

6261
namespace nvexec::_strm::repeat_n {
6362
template <class OpT>

examples/nvexec/maxwell_cpu_mt.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <iostream>
18+
1719
#include "maxwell/snr.cuh"
1820
#include "maxwell/std.cuh"
1921
#include "maxwell/stdpar.cuh"

include/nvexec/stream/algorithm_base.cuh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ namespace nvexec::_strm::__algo_range_init_fun {
8686
op_state_.propagate_completion_signal(set_stopped_t());
8787
}
8888

89+
[[nodiscard]]
8990
auto get_env() const noexcept -> env_of_t<Receiver> {
9091
return stdexec::get_env(op_state_.rcvr_);
9192
}

include/nvexec/stream/bulk.cuh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ namespace nvexec::_strm {
8484
op_state_.propagate_completion_signal(set_stopped_t());
8585
}
8686

87+
[[nodiscard]]
8788
auto get_env() const noexcept -> Env {
8889
return op_state_.make_env();
8990
}
@@ -172,7 +173,7 @@ namespace nvexec::_strm {
172173

173174
operation_t<CvrefSenderId, ReceiverId, Shape, Fun>& op_state_;
174175

175-
static auto even_share(Shape n, std::size_t rank, std::size_t size) noexcept
176+
static auto even_share(Shape n, std::size_t rank, std::size_t size) noexcept //
176177
-> std::pair<Shape, Shape> {
177178
const auto avg_per_thread = n / size;
178179
const auto n_big_share = avg_per_thread + 1;
@@ -252,6 +253,7 @@ namespace nvexec::_strm {
252253
op_state_.propagate_completion_signal(set_stopped_t());
253254
}
254255

256+
[[nodiscard]]
255257
auto get_env() const noexcept -> env_of_t<Receiver> {
256258
return stdexec::get_env(op_state_.rcvr_);
257259
}
@@ -328,10 +330,11 @@ namespace nvexec::_strm {
328330
};
329331
} // namespace multi_gpu_bulk
330332

331-
template <class SenderId, std::integral Shape, class Fun>
333+
template <class SenderId, class Shape, class Fun>
332334
struct multi_gpu_bulk_sender_t {
333335
using sender_concept = stdexec::sender_t;
334336
using Sender = stdexec::__t<SenderId>;
337+
static_assert(std::integral<Shape>);
335338

336339
struct __t : stream_sender_base {
337340
using __id = multi_gpu_bulk_sender_t;

include/nvexec/stream/common.cuh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "../detail/throw_on_cuda_error.cuh"
3434
#include "../detail/queue.cuh"
3535
#include "../detail/variant.cuh"
36-
#include "stdexec/__detail/__config.hpp"
3736

3837
STDEXEC_PRAGMA_PUSH()
3938
STDEXEC_PRAGMA_IGNORE_EDG(cuda_compile)
@@ -52,7 +51,7 @@ namespace nvexec {
5251
device
5352
};
5453

55-
#if defined(__clang__) && defined(__CUDA__)
54+
#if defined(__clang__) && defined(__CUDA__) && !defined(STDEXEC_CLANG_TIDY)
5655
__host__ inline auto get_device_type() noexcept -> device_type {
5756
return device_type::host;
5857
}
@@ -61,12 +60,12 @@ namespace nvexec {
6160
return device_type::device;
6261
}
6362
#else
64-
__host__ __device__ inline device_type get_device_type() noexcept {
63+
__host__ __device__ inline auto get_device_type() noexcept -> device_type {
6564
NV_IF_TARGET(NV_IS_HOST, (return device_type::host;), (return device_type::device;));
6665
}
6766
#endif
6867

69-
inline STDEXEC_ATTRIBUTE((host, device)) bool is_on_gpu() noexcept {
68+
inline STDEXEC_ATTRIBUTE((host, device)) auto is_on_gpu() noexcept -> bool {
7069
return get_device_type() == device_type::device;
7170
}
7271
} // namespace nvexec
@@ -470,15 +469,8 @@ namespace nvexec {
470469
};
471470

472471
template <class Env>
473-
requires tag_invocable<get_stream_provider_t, const __decay_t<Env>&>
474472
constexpr auto borrows_stream_h() -> bool {
475-
return true;
476-
}
477-
478-
template <class Env>
479-
requires(!tag_invocable<get_stream_provider_t, const __decay_t<Env>>)
480-
constexpr auto borrows_stream_h() -> bool {
481-
return false;
473+
return __callable<get_stream_provider_t, const Env&>;
482474
}
483475

484476
template <class OuterReceiverId>
@@ -741,7 +733,7 @@ namespace nvexec {
741733
stdexec::__id<OuterReceiver>>;
742734

743735
template <class Sender, class OuterReceiver>
744-
auto exit_op_state(Sender&& sndr, OuterReceiver&& rcvr, context_state_t context_state) noexcept
736+
auto exit_op_state(Sender&& sndr, OuterReceiver rcvr, context_state_t context_state) noexcept
745737
-> exit_operation_state_t<Sender, OuterReceiver> {
746738
using ReceiverId = stdexec::__id<OuterReceiver>;
747739
return exit_operation_state_t<Sender, OuterReceiver>(

include/nvexec/stream/continues_on.cuh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ namespace nvexec::_strm {
5555
stdexec::set_stopped(std::move(op_state_.rcvr_));
5656
}
5757

58+
[[nodiscard]]
5859
auto get_env() const noexcept -> Env {
5960
return op_state_.make_env();
6061
}

include/nvexec/stream/launch.cuh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ namespace nvexec {
8383
op_state_.propagate_completion_signal(set_stopped_t());
8484
}
8585

86+
[[nodiscard]]
8687
auto get_env() const noexcept -> typename operation_state_base_t<ReceiverId>::env_t {
8788
return op_state_.make_env();
8889
}

include/nvexec/stream/schedule_from.cuh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ namespace nvexec::_strm {
143143
complete(set_stopped_t());
144144
}
145145

146+
[[nodiscard]]
146147
auto get_env() const noexcept -> Env {
147148
return operation_state_.make_env();
148149
}
@@ -157,6 +158,7 @@ namespace nvexec::_strm {
157158
return stdexec::connect(static_cast<Self&&>(self).sndr_, static_cast<Receiver&&>(rcvr));
158159
}
159160

161+
[[nodiscard]]
160162
auto get_env() const noexcept -> env_of_t<const Sender&> {
161163
// TODO - this code is not exercised by any test
162164
return stdexec::get_env(sndr_);

include/nvexec/stream/split.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include "../../stdexec/execution.hpp"
22-
#include "../../exec/env.hpp"
2322

2423
#include <atomic>
2524
#include <memory>
@@ -344,7 +343,7 @@ namespace nvexec::_strm {
344343
using completion_signatures = //
345344
__try_make_completion_signatures<
346345
Sender,
347-
exec::make_env_t<stdexec::prop<get_stop_token_t, inplace_stop_token>>,
346+
stdexec::prop<get_stop_token_t, inplace_stop_token>,
348347
stdexec::completion_signatures<set_error_t(const cudaError_t&)>,
349348
__q<_set_value_t>,
350349
__q<_set_error_t>>;
@@ -358,6 +357,7 @@ namespace nvexec::_strm {
358357
return operation_t<Receiver>{static_cast<Receiver&&>(rcvr), shared_state_};
359358
}
360359

360+
[[nodiscard]]
361361
auto get_env() const noexcept -> env_of_t<const Sender&> {
362362
return stdexec::get_env(sndr_);
363363
}

include/nvexec/stream/submit.cuh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,16 @@ namespace nvexec::_strm::_submit {
6666
Receiver rcvr_;
6767
connect_result_t<Sender, receiver_t> op_state_;
6868

69-
template <__decays_to<Receiver> CvrefReceiver>
70-
op_state_t(Sender&& sndr, CvrefReceiver&& rcvr)
71-
: rcvr_(static_cast<CvrefReceiver&&>(rcvr))
69+
op_state_t(Sender&& sndr, Receiver rcvr)
70+
: rcvr_(static_cast<Receiver&&>(rcvr))
7271
, op_state_(connect(static_cast<Sender&&>(sndr), receiver_t{{}, this})) {
7372
}
7473
};
7574

7675
struct submit_t {
7776
template <receiver Receiver, sender_to<Receiver> Sender>
78-
void operator()(Sender&& sndr, Receiver&& rcvr) const noexcept(false) {
79-
start((new op_state_t<stdexec::__id<Sender>, stdexec::__id<__decay_t<Receiver>>>{
77+
void operator()(Sender&& sndr, Receiver rcvr) const noexcept(false) {
78+
start((new op_state_t<__id<Sender>, __id<Receiver>>{
8079
static_cast<Sender&&>(sndr), static_cast<Receiver&&>(rcvr)})
8180
->op_state_);
8281
}

0 commit comments

Comments
 (0)