Skip to content

Commit

Permalink
improve management of build flags for the precompiled/baked use-case
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardGe committed Jan 10, 2025
1 parent e8da229 commit abbd1ed
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions ParallelPrimitives/RadixSort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@
#include <iostream>
#include <numeric>

#if defined( ORO_PP_LOAD_FROM_STRING )

// if ORO_PP_LOAD_FROM_STRING && ORO_PRECOMPILED -> we load the precompiled/baked kernels.
// if ORO_PP_LOAD_FROM_STRING && NOT ORO_PRECOMPILED -> we load the baked source code kernels (from Kernels.h / KernelArgs.h)
#if !defined( ORO_PRECOMPILED ) && defined( ORO_PP_LOAD_FROM_STRING )
// Note: the include order must be in this particular form.
// clang-format off
#include <ParallelPrimitives/cache/Kernels.h>
#include <ParallelPrimitives/cache/KernelArgs.h>
// clang-format on
#else
// if Kernels.h / KernelArgs.h are not included, declare nullptr strings
static const char* hip_RadixSortKernels = nullptr;
namespace hip
{
static const char** RadixSortKernelsArgs = nullptr;
static const char** RadixSortKernelsIncludes = nullptr;
}
#endif

#if defined( __GNUC__ )
Expand Down Expand Up @@ -73,12 +82,6 @@ namespace
constexpr auto useBakeKernel = true; // this flag means we use the HIP source code embeded in the binary ( as a string )
#else
constexpr auto useBakeKernel = false;
static const char* hip_RadixSortKernels = nullptr;
namespace hip
{
static const char** RadixSortKernelsArgs = nullptr;
static const char** RadixSortKernelsIncludes = nullptr;
} // namespace hip
#endif

#endif
Expand Down

0 comments on commit abbd1ed

Please sign in to comment.