Skip to content

Commit

Permalink
Protect HIP and CUDA sketching kernels with namespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
pelesh committed Mar 11, 2024
1 parent 9738a16 commit f952e0a
Show file tree
Hide file tree
Showing 10 changed files with 587 additions and 573 deletions.
496 changes: 250 additions & 246 deletions resolve/cuda/cudaSketchingKernels.cu

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions resolve/cuda/cudaSketchingKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@

#include <resolve/Common.hpp>

namespace ReSolve {
namespace ReSolve
{
namespace cuda
{
// needed for rand solver
void count_sketch_theta(index_type n,
index_type k,
const index_type* labels,
const index_type* flip,
const real_type* input,
real_type* output);

// needed for rand solver
void count_sketch_theta(index_type n,
index_type k,
const index_type* labels,
const index_type* flip,
const real_type* input,
real_type* output);
void FWHT_select(index_type k,
const index_type* perm,
const real_type* input,
real_type* output);

void FWHT_select(index_type k,
const index_type* perm,
const real_type* input,
real_type* output);

void FWHT_scaleByD(index_type n,
const index_type* D,
const real_type* x,
real_type* y);

void FWHT(index_type M, index_type log2N, real_type* d_Data);
void FWHT_scaleByD(index_type n,
const index_type* D,
const real_type* x,
real_type* y);

void FWHT(index_type M, index_type log2N, real_type* d_Data);
}
} // namespace ReSolve
8 changes: 4 additions & 4 deletions resolve/cuda/cudaVectorKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
#include <resolve/cuda/cudaVectorKernels.h>


namespace ReSolve {

namespace kernels {
namespace ReSolve
{
namespace kernels
{

/**
* @brief CUDA kernel that sets values of an array to a constant.
Expand Down Expand Up @@ -44,5 +45,4 @@ namespace ReSolve {
num_blocks = (n + block_size - 1) / block_size;
kernels::set_const<<<num_blocks, block_size>>>(n, val, arr);
}

} // namespace ReSolve
39 changes: 21 additions & 18 deletions resolve/hip/hipSketchingKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@

#include <resolve/Common.hpp>

namespace ReSolve {
// needed for rand solver
void count_sketch_theta(index_type n,
index_type k,
index_type* labels,
index_type* flip,
real_type* input,
real_type* output);
namespace ReSolve
{
namespace hip
{
// needed for rand solver
void count_sketch_theta(index_type n,
index_type k,
index_type* labels,
index_type* flip,
real_type* input,
real_type* output);

void FWHT_select(index_type k,
index_type* perm,
real_type* input,
real_type* output);
void FWHT_select(index_type k,
index_type* perm,
real_type* input,
real_type* output);

void FWHT_scaleByD(index_type n,
index_type* D,
real_type* x,
real_type* y);

void FWHT(index_type M, index_type log2N, real_type* d_Data);
void FWHT_scaleByD(index_type n,
index_type* D,
real_type* x,
real_type* y);

void FWHT(index_type M, index_type log2N, real_type* d_Data);
} // namespace hip
} // namespace ReSolve
Loading

0 comments on commit f952e0a

Please sign in to comment.