Skip to content

Commit 56113ab

Browse files
Updated comments for helper functions
1 parent ef4e4a0 commit 56113ab

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

clang/runtime/dpct-rt/include/dpct/shmem_utils.hpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,32 @@
1111

1212
namespace dpct::shmem {
1313

14-
/// Initialize Intel SHMEM runtime based on exisiting communicator in attributes
14+
/// Initialize Intel SHMEM library based on exisiting communicator
1515
/// \param [in] runtime_flags specify the underlying communicator like MPI/
1616
/// OpenSHMEM to initialize iSHMEM for launcher agnostic bootstrapping
17-
/// \param [in] attr attributes of existing communicator
18-
void init_attr(unsigned runtime_flags, ishmemx_attr_t *attr) {
17+
/// \param [in] attr Additional attributes for initializing the iSHMEM library.
18+
void init_attr(ishmemx_runtime_type_t runtime_flags, ishmemx_attr_t *attr) {
1919
if (runtime_flags == 0) {
2020
// if no runtime flags are present, initialize iSHMEM normally
2121
ishmem_init();
2222
} else {
23-
attr->runtime = static_cast<ishmemx_runtime_type_t>(runtime_flags);
23+
attr->runtime = runtime_flags;
2424
ishmemx_init_attr(attr);
2525
}
2626
}
2727

2828
/// Update signal address with signal using signal operation
29-
/// \param [out] sig_addr Address of the signal to be updated
30-
/// \param [in] signal Value of the signal to update
31-
/// \param [in] sig_op Operator used in updating signal address
32-
/// \param [in] PE Processing element
33-
void signal_op(uint64_t *sig_addr, uint64_t signal, int sig_op, int PE) {
29+
/// \param [out] sig_addr Symmetric address of the signal data object to be
30+
/// updated on the remote PE.
31+
/// \param [in] signal Unsigned 64-bit value that is used for updating the
32+
/// remote sig_addr signal data object.
33+
/// \param [in] sig_op Operator used to update signal data object
34+
/// \param [in] pe Processing element
35+
void signal_op(uint64_t *sig_addr, uint64_t signal, int sig_op, int pe) {
3436
if (sig_op == ISHMEM_SIGNAL_SET) {
35-
ishmemx_signal_set(sig_addr, signal, PE);
37+
ishmemx_signal_set(sig_addr, signal, pe);
3638
} else if (sig_op == ISHMEM_SIGNAL_ADD) {
37-
ishmemx_signal_add(sig_addr, signal, PE);
39+
ishmemx_signal_add(sig_addr, signal, pe);
3840
} else {
3941
throw std::runtime_error("Unsupported signal operator!");
4042
}

0 commit comments

Comments
 (0)