Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nlesc-recruit/cudawrappers into add…
Browse files Browse the repository at this point in the history
…_test_framework
  • Loading branch information
bouweandela committed Jun 23, 2023
2 parents 71c4cfe + 64683b2 commit 796b620
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.4
rev: v16.0.6
hooks:
- id: clang-format
- repo: https://github.com/pocc/pre-commit-hooks
Expand Down
25 changes: 20 additions & 5 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ authors:
affiliation: ASTRON
email: vlugt@astron.nl
orcid: 'https://orcid.org/0000-0001-6834-4860'
- given-names: Mattia
family-names: Mancini
affiliation: ASTRON
email: mancini@astron.nl
orcid: 'https://orcid.org/0000-0002-3861-9234'
- given-names: Bouwe
family-names: Andela
email: b.andela@esciencecenter.nl
affiliation: Netherlands eScience Center
orcid: 'https://orcid.org/0000-0001-9005-8940'
- given-names: Leon
family-names: Oostrum
email: l.oostrum@esciencecenter.nl
affiliation: Netherlands eScience Center
orcid: 'https://orcid.org/0000-0001-8724-8372'
- given-names: Laura
family-names: Ootes
email: l.ootes@esciencecenter.nl
affiliation: Netherlands eScience Center
orcid: 'https://orcid.org/0000-0002-2800-8309'
- given-names: Ben
name-particle: van
family-names: Werkhoven
Expand All @@ -48,11 +68,6 @@ authors:
email: abel.siqueira@esciencecenter.nl
affiliation: Netherlands eScience Center
orcid: 'https://orcid.org/0000-0003-4451-281X'
- given-names: Bouwe
family-names: Andela
email: b.andela@esciencecenter.nl
affiliation: Netherlands eScience Center
orcid: 'https://orcid.org/0000-0001-9005-8940'
identifiers:
- type: doi
value: 10.5281/zenodo.6076447
Expand Down
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ channels:
- conda-forge
dependencies:
- c-compiler
- clang==16.0.4
- clang-tools==16.0.4
- clang==16.0.6
- clang-tools==16.0.6
- cmake>=3.17
- cppcheck==2.10.3
- cudatoolkit-dev>=10.0
Expand All @@ -18,6 +18,6 @@ dependencies:
- yamllint==1.31.0
- pip:
- pre-commit
- clang-format==16.0.4
- clang-format==16.0.6
- cmakelang==0.6.13
- flawfinder==2.0.19
1 change: 0 additions & 1 deletion examples/vector_add/vector_add.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Do not complain about using pointer arithmetic in this test file
// NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)
#include <cstddef>
#include <iostream>
Expand Down
80 changes: 0 additions & 80 deletions include/cudawrappers/cu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,6 @@ class Module : public Wrapper<CUmodule> {

explicit Module(CUmodule &module) : Wrapper(module) {}

#if 0
TexRef getTexRef(const char *name) const
{
CUtexref texref;
checkCudaCall(cuModuleGetTexRef(&texref, _obj, name));
return TexRef(texref);
}
#endif

CUdeviceptr getGlobal(const char *name) const {
CUdeviceptr deviceptr{};
checkCudaCall(cuModuleGetGlobal(&deviceptr, nullptr, _obj, name));
Expand Down Expand Up @@ -483,77 +474,6 @@ class Stream : public Wrapper<CUstream> {
}
};

#if 0
class Graph : public Wrapper<CUgraph>
{
public:
class GraphNode : public Wrapper<CUgraphNode>
{
};

class ExecKernelNode : public GraphNode
{
};

class KernelNodeParams : public Wrapper<CUDA_KERNEL_NODE_PARAMS>
{
public:
KernelNodeParams(const Function &function,
unsigned gridDimX, unsigned gridDimY, unsigned gridDimZ,
unsigned blockDimX, unsigned blockDimY, unsigned blockDimZ,
unsigned sharedMemBytes,
const std::vector<const void *> &kernelParams)
{
_obj.func = function;
_obj.blockDimX = blockDimX;
_obj.blockDimY = blockDimY;
_obj.blockDimZ = blockDimZ;
_obj.gridDimX = gridDimX;
_obj.gridDimY = gridDimY;
_obj.gridDimZ = gridDimZ;
_obj.sharedMemBytes = sharedMemBytes;
_obj.kernelParams = const_cast<void **>(kernelParams.data());
_obj.extra = nullptr;
}
};

class Exec : public Wrapper<CUgraphExec>
{
public:
void launch(Stream &stream)
{
checkCudaCall(cuGraphLaunch(_obj, stream));
}
};

Graph(unsigned flags = 0)
{
checkCudaCall(cuGraphCreate(&_obj, flags));
manager = std::shared_ptr<CUgraphNode>(new CUgraphNode(_obj), [] (CUgraphNode *ptr) { cuGraphDestroy(*ptr); delete ptr; });
}

Graph(CUgraph &graph)
:
Wrapper(graph)
{
}

ExecKernelNode addKernelNode(/* std::vector<GraphNode> dependencies, */ const KernelNodeParams &kernelArgs)
{
ExecKernelNode node;
checkCudaCall(cuGraphAddKernelNode(& (CUgraphNode &) node, _obj, nullptr, 0, & (const CUDA_KERNEL_NODE_PARAMS &) kernelArgs));
return node;
}

Exec instantiate()
{
Exec exec;
checkCudaCall(cuGraphInstantiate(& (CUgraphExec &) exec, _obj, nullptr, nullptr, 0));
return exec;
}
};
#endif

inline void Event::record(Stream &stream) {
checkCudaCall(cuEventRecord(_obj, stream._obj));
}
Expand Down

0 comments on commit 796b620

Please sign in to comment.