Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
shamalgs::atomic::ErrorCheckCounter Struct Reference

This class is used to check for errors in kernels. It is composed of a buffer of u32 that is used to store the error counts. More...

#include <shamalgs/include/shamalgs/atomic/ErrorChecker.hpp>

+ Collaboration diagram for shamalgs::atomic::ErrorCheckCounter:

Classes

struct  accessed
 A struct to access the pointer associated to the buffer. More...
 

Public Member Functions

 ErrorCheckCounter (sham::DeviceScheduler_ptr sched, u32 error_counter)
 Constructor.
 
accessed get_write_access (sham::EventList &depends_list)
 Get a write access to the buffer.
 
void complete_event_state (sycl::event e)
 Complete the event state.
 
std::vector< u32get_outputs ()
 Get the resulting error counts.
 

Public Attributes

sham::DeviceBuffer< u32buf_err
 The buffer used to store the error counts.
 

Detailed Description

This class is used to check for errors in kernels. It is composed of a buffer of u32 that is used to store the error counts.

The class provides a method to count errors for multiple flags. The flags are set by doing a fetch add operation on the corresponding element of the buffer. The element is chosen by the argument of the set_error method. The value of the element is incremented by 1 each time the set_error method is called.

auto sched = shamsys::instance::get_compute_scheduler_ptr();
sched->get_queue(),
sham::MultiRef{error_util},
100,
[](u32 i, auto error_util) {
if (i == 2) {
error_util.set_error(0);
}
if (i == 23 || i == 101) {
error_util.set_error(1);
}
});
auto precondition_error = error_util.get_outputs();
std::uint32_t u32
32 bit unsigned integer
void kernel_call(sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
Submit a kernel to a SYCL queue.
A class that references multiple buffers or similar objects.
This class is used to check for errors in kernels. It is composed of a buffer of u32 that is used to ...

Definition at line 135 of file ErrorChecker.hpp.

Constructor & Destructor Documentation

◆ ErrorCheckCounter()

shamalgs::atomic::ErrorCheckCounter::ErrorCheckCounter ( sham::DeviceScheduler_ptr  sched,
u32  error_counter 
)
inline

Constructor.

Definition at line 141 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ complete_event_state()

void shamalgs::atomic::ErrorCheckCounter::complete_event_state ( sycl::event  e)
inline

Complete the event state.

Definition at line 168 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

◆ get_outputs()

std::vector< u32 > shamalgs::atomic::ErrorCheckCounter::get_outputs ( )
inline

Get the resulting error counts.

Definition at line 171 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

◆ get_write_access()

accessed shamalgs::atomic::ErrorCheckCounter::get_write_access ( sham::EventList depends_list)
inline

Get a write access to the buffer.

Definition at line 163 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ buf_err

sham::DeviceBuffer<u32> shamalgs::atomic::ErrorCheckCounter::buf_err

The buffer used to store the error counts.

Definition at line 138 of file ErrorChecker.hpp.


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