kokkos-execution 0.0.1
Loading...
Searching...
No Matches
Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test Class Reference
Inheritance diagram for Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test:
Tests::ExecutionSpaceImpl::LetValueTest Tests::Utils::ExecutionSpaceContextTest< TEST_EXECUTION_SPACE > Kokkos::utils::tests::scoped::callbacks::Manager Tests::Utils::ContextTest< Kokkos::Execution::ExecutionSpaceContext, Exec > Kokkos::utils::tests::scoped::ExecutionSpace< Exec >

Public Member Functions

 LetValueTest_scoped_allocation_Test ()=default
 ~LetValueTest_scoped_allocation_Test () override=default
 LetValueTest_scoped_allocation_Test (const LetValueTest_scoped_allocation_Test &)=delete
LetValueTest_scoped_allocation_Testoperator= (const LetValueTest_scoped_allocation_Test &)=delete
 LetValueTest_scoped_allocation_Test (LetValueTest_scoped_allocation_Test &&) noexcept=delete
LetValueTest_scoped_allocation_Testoperator= (LetValueTest_scoped_allocation_Test &&) noexcept=delete
Public Member Functions inherited from Kokkos::utils::tests::scoped::ExecutionSpace< Exec >
 ExecutionSpace ()
ExecutionSpaceoperator= (const ExecutionSpace &)=delete
Public Member Functions inherited from Kokkos::utils::tests::scoped::callbacks::Manager
 Manager ()
 ~Manager ()
 Manager (const Manager &)=delete
Manageroperator= (const Manager &)=delete

Private Member Functions

void TestBody () override

Static Private Attributes

static ::testing::TestInfo *const test_info_ = ::testing::internal::MakeAndRegisterTestInfo( "LetValueTest", "scoped_allocation", nullptr, nullptr, ::testing::internal::CodeLocation(__FILE__, __LINE__), (::testing::internal::GetTypeId<LetValueTest>()), ::testing::internal::SuiteApiResolver< LetValueTest>::GetSetUpCaseOrSuite(__FILE__, __LINE__), ::testing::internal::SuiteApiResolver< LetValueTest>::GetTearDownCaseOrSuite(__FILE__, __LINE__), new ::testing::internal::TestFactoryImpl< LetValueTest_scoped_allocation_Test >)

Additional Inherited Members

Public Types inherited from Tests::ExecutionSpaceImpl::LetValueTest
using recorder_listener_t
using variant_t = typename recorder_listener_t::event_variant_t
Public Types inherited from Tests::Utils::ContextTest< Kokkos::Execution::ExecutionSpaceContext, Exec >
using context_t
using scheduler_t
using schedule_sender_t
using value_t
using view_s_t
Public Attributes inherited from Kokkos::utils::tests::scoped::ExecutionSpace< Exec >
Exec exec
Static Public Attributes inherited from Tests::Utils::ContextTest< Kokkos::Execution::ExecutionSpaceContext, Exec >
static constexpr bool on_device

Detailed Description

Test
Use the value channel and stdexec::let_value to keep a "scratch" Kokkos view alive during the computations.

Definition at line 51 of file test_let_value.cpp.

Constructor & Destructor Documentation

◆ LetValueTest_scoped_allocation_Test() [1/3]

◆ ~LetValueTest_scoped_allocation_Test()

Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::~LetValueTest_scoped_allocation_Test ( )
overridedefault

◆ LetValueTest_scoped_allocation_Test() [2/3]

Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::LetValueTest_scoped_allocation_Test ( const LetValueTest_scoped_allocation_Test & )
delete

◆ LetValueTest_scoped_allocation_Test() [3/3]

Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::LetValueTest_scoped_allocation_Test ( LetValueTest_scoped_allocation_Test && )
deletenoexcept

Member Function Documentation

◆ operator=() [1/2]

LetValueTest_scoped_allocation_Test & Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::operator= ( const LetValueTest_scoped_allocation_Test & )
delete

◆ operator=() [2/2]

LetValueTest_scoped_allocation_Test & Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::operator= ( LetValueTest_scoped_allocation_Test && )
deletenoexcept

◆ TestBody()

void Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::TestBody ( )
overrideprivate

Allocate a Kokkos view only when the sender is running, put it in the value channel.

Kokkos::View is nothrow movable, so the error channel is not added.

Use the scratch view to make some meaningful computation.

The operation state of stdexec::let_value stores the arguments in a decayed tuple and passes references to them when invoking the lambda.

The use count includes the views in the stdexec::let_value operation state and the stdexec::bulk closure.

There is also a copy in the Kokkos parallel region, but it is not included in the use count because of Kokkos::parallel_for uses Kokkos::Impl::construct_with_shared_allocation_tracking_disabled.

The use count includes the views in the stdexec::let_value operation state and the stdexec::bulk closure.

Check the result of the computation.

The implementation of stdexec::let_value uses a single variant to store the predecessor and successor operation states.

The predecessor operation state is still alive when the lambda is invoked to construct the successor sender. The predecessor operation state is destroyed only when the successor sender is connected and assigned to the variant.

The use count includes the views in the "run" stdexec::bulk closure and the "check" stdexec::let_value operation state.

The "run" stdexec::then lambda moved the view held by the "run" stdexec::let_value operation state, so it no longer contributes to the use count at this point.

The use count includes the views in the "check" stdexec::let_value operation state and the stdexec::bulk closure

There is also a copy in the Kokkos parallel region, but it is not included in the use count because of Kokkos::parallel_for uses Kokkos::Impl::construct_with_shared_allocation_tracking_disabled.

Definition at line 51 of file test_let_value.cpp.

Member Data Documentation

◆ test_info_

testing::TestInfo *const Tests::ExecutionSpaceImpl::LetValueTest_scoped_allocation_Test::test_info_ = ::testing::internal::MakeAndRegisterTestInfo( "LetValueTest", "scoped_allocation", nullptr, nullptr, ::testing::internal::CodeLocation(__FILE__, __LINE__), (::testing::internal::GetTypeId<LetValueTest>()), ::testing::internal::SuiteApiResolver< LetValueTest>::GetSetUpCaseOrSuite(__FILE__, __LINE__), ::testing::internal::SuiteApiResolver< LetValueTest>::GetTearDownCaseOrSuite(__FILE__, __LINE__), new ::testing::internal::TestFactoryImpl< LetValueTest_scoped_allocation_Test >)
staticprivate

Definition at line 51 of file test_let_value.cpp.


The documentation for this class was generated from the following file: