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

A utility class to check for errors on device, using a single uint to store all the error flags. More...

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

+ Collaboration diagram for shamalgs::atomic::ErrorCheckerFlags:

Classes

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

Public Member Functions

 ErrorCheckerFlags (sham::DeviceScheduler_ptr sched)
 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.
 
u32 get_output ()
 Get the resulting error flag.
 

Public Attributes

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

Detailed Description

A utility class to check for errors on device, using a single uint to store all the error flags.

This class provides a way to check for errors on device, using a single uint to store all the error flags. The error flags are packed in the uint and can be checked using the is_flag_on function.

auto sched = shamsys::instance::get_compute_scheduler_ptr();
enum ErrorCodes : u32 {
Flag1 = 1 << 0,
Flag2 = 1 << 1,
Flag3 = 1 << 2,
};
sched->get_queue(),
sham::MultiRef{error_util},
100,
[](u32 i, auto error_util) {
if (i == 2) {
error_util.set_flag_on(Flag1);
}
if (i == 23 || i == 101) {
error_util.set_flag_on(Flag2);
}
});
u32 precondition_error = error_util.get_output();
bool Flag_1_on = shambase::is_flag_on<Flag1>(precondition_error);
bool Flag_2_on = shambase::is_flag_on<Flag2>(precondition_error);
bool Flag_3_on = shambase::is_flag_on<Flag3>(precondition_error);
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.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
A class that references multiple buffers or similar objects.
A utility class to check for errors on device, using a single uint to store all the error flags.

Definition at line 66 of file ErrorChecker.hpp.

Constructor & Destructor Documentation

◆ ErrorCheckerFlags()

shamalgs::atomic::ErrorCheckerFlags::ErrorCheckerFlags ( sham::DeviceScheduler_ptr  sched)
inline

Constructor.

Definition at line 72 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ complete_event_state()

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

Complete the event state.

Definition at line 96 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

◆ get_output()

u32 shamalgs::atomic::ErrorCheckerFlags::get_output ( )
inline

Get the resulting error flag.

Definition at line 99 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

◆ get_write_access()

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

Get a write access to the buffer.

Definition at line 91 of file ErrorChecker.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ buf_err

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

The buffer used to store the error flag.

Definition at line 69 of file ErrorChecker.hpp.


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