Skip to content

Commit

Permalink
Fixes #671: Renamed a macro: CAN_GET_APRIORI_KERNEL_HANDLE -> `CAW_…
Browse files Browse the repository at this point in the history
…CAN_GET_APRIORI_KERNEL_HANDLE`
  • Loading branch information
eyalroz committed Sep 5, 2024
1 parent a29ba63 commit 641e074
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/cuda/api/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

///@cond
#if CUDA_VERSION < 11000
#define CAN_GET_APRIORI_KERNEL_HANDLE 0
#define CAW_CAN_GET_APRIORI_KERNEL_HANDLE 0
#define VIRTUAL_UNLESS_CAN_GET_APRIORI_KERNEL_HANDLE virtual
#else
#define CAN_GET_APRIORI_KERNEL_HANDLE 1
#define CAW_CAN_GET_APRIORI_KERNEL_HANDLE 1
#define VIRTUAL_UNLESS_CAN_GET_APRIORI_KERNEL_HANDLE
#endif
///@endcond
Expand Down Expand Up @@ -144,7 +144,7 @@ class kernel_t {
* @note for earlier versions of CUDA, and for apriori-compiled kernels, this
* handle may be unavailable.
*/
#if CAN_GET_APRIORI_KERNEL_HANDLE
#if CAW_CAN_GET_APRIORI_KERNEL_HANDLE
kernel::handle_t handle() const noexcept { return handle_; }
#else
kernel::handle_t handle() const
Expand Down
16 changes: 8 additions & 8 deletions src/cuda/api/kernels/apriori_compiled.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ apriori_compiled_t wrap(
} // namespace detail_


#if ! CAN_GET_APRIORI_KERNEL_HANDLE
#if ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE
/**
* @brief a wrapper around `cudaFuncAttributes`, offering
* a few convenience member functions.
Expand All @@ -74,7 +74,7 @@ struct attributes_t : cudaFuncAttributes {
}
};

#endif // CAN_GET_APRIORI_KERNEL_HANDLE
#endif // CAW_CAN_GET_APRIORI_KERNEL_HANDLE

namespace occupancy {

Expand Down Expand Up @@ -325,7 +325,7 @@ class apriori_compiled_t final : public kernel_t {

public: // non-mutators

#if ! CAN_GET_APRIORI_KERNEL_HANDLE
#if ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE

/// Obtain the set of all attributes one can obtain individually with @ref get_attribute
apriori_compiled::attributes_t attributes() const;
Expand Down Expand Up @@ -419,7 +419,7 @@ class apriori_compiled_t final : public kernel_t {
dynamic_shared_memory_per_block,
disable_caching_override);
}
#endif // ! CAN_GET_APRIORI_KERNEL_HANDLE
#endif // ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE

protected: // ctors & dtor
apriori_compiled_t(device::id_t device_id, context::handle_t primary_context_handle,
Expand Down Expand Up @@ -468,17 +468,17 @@ inline apriori_compiled_t wrap(
return { device_id, primary_context_handle, f, ptr, hold_primary_context_refcount_unit };
}

#if ! CAN_GET_APRIORI_KERNEL_HANDLE
#if ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE
inline ::std::string identify(const apriori_compiled_t& kernel)
{
return "apriori-compiled kernel " + cuda::detail_::ptr_as_hex(kernel.ptr())
+ " in " + context::detail_::identify(kernel.context());
}
#endif // ! CAN_GET_APRIORI_KERNEL_HANDLE
#endif // ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE

} // namespace detail

#if CAN_GET_APRIORI_KERNEL_HANDLE
#if CAW_CAN_GET_APRIORI_KERNEL_HANDLE
inline attribute_value_t get_attribute(const void* function_ptr, attribute_t attribute)
{
auto handle = detail_::get_handle(function_ptr);
Expand Down Expand Up @@ -509,7 +509,7 @@ inline void set_attribute(
CAW_SET_SCOPE_CONTEXT(context.handle());
return set_attribute(function_ptr, attribute, value);
}
#endif // CAN_GET_APRIORI_KERNEL_HANDLE
#endif // CAW_CAN_GET_APRIORI_KERNEL_HANDLE

} // namespace apriori_compiled

Expand Down
6 changes: 3 additions & 3 deletions src/cuda/api/multi_wrapper_impls/apriori_compiled_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace cuda {

namespace kernel {

#if ! CAN_GET_APRIORI_KERNEL_HANDLE
#if ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE
#if defined(__CUDACC__)

// Unfortunately, the CUDA runtime API does not allow for computation of the grid parameters for maximum occupancy
Expand Down Expand Up @@ -112,7 +112,7 @@ inline attribute_value_t apriori_compiled_t::get_attribute(attribute_t attribute
}

#endif // defined(__CUDACC__)
#endif // ! CAN_GET_APRIORI_KERNEL_HANDLE
#endif // ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE

namespace apriori_compiled {

Expand All @@ -130,7 +130,7 @@ apriori_compiled_t get(
"function must be a bona fide pointer to a kernel (__global__) function");

auto ptr_ = reinterpret_cast<const void *>(function_ptr);
#if CAN_GET_APRIORI_KERNEL_HANDLE
#if CAW_CAN_GET_APRIORI_KERNEL_HANDLE
auto handle = detail_::get_handle(ptr_);
#else
auto handle = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions src/cuda/api/multi_wrapper_impls/kernel_launch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void launch_type_erased(
}
#endif // CUDA_VERSION >= 12000

#if ! CAN_GET_APRIORI_KERNEL_HANDLE
#if ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE

#if defined(__CUDACC__)

Expand Down Expand Up @@ -512,7 +512,7 @@ grid::composite_dimensions_t min_grid_params_for_max_occupancy(
#endif // CUDA_VERSION >= 10000

#endif // defined(__CUDACC__)
#endif // ! CAN_GET_APRIORI_KERNEL_HANDLE
#endif // ! CAW_CAN_GET_APRIORI_KERNEL_HANDLE

} // namespace cuda

Expand Down

0 comments on commit 641e074

Please sign in to comment.