-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux build + C++17 compatibility option
- Loading branch information
1 parent
4305ffa
commit 2e60046
Showing
23 changed files
with
105 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Files to tell git to ignore | ||
|
||
/src/.vs | ||
/src/ort | ||
/src/build | ||
/ort | ||
/build | ||
/src/models/files/*.onnx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
git submodule update --init --recursive | ||
|
||
cuda_version="cuda" | ||
cuda_arch=70 | ||
|
||
export CUDA_HOME="/usr/local/${cuda_version}" | ||
export CUDNN_HOME="/usr/local/${cuda_version}" | ||
cuda_compiler="/usr/local/${cuda_version}/bin/nvcc" | ||
|
||
cd src | ||
cmake -S . -B build -DCMAKE_CUDA_ARCHITECTURES=$cuda_arch -DCMAKE_CUDA_COMPILER=$cuda_compiler -DCMAKE_POSITION_INDEPENDENT_CODE=ON | ||
cd build | ||
make |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p src/ort | ||
|
||
cp ~/onnxruntime/include/onnxruntime/core/session/onnxruntime_c*.h src/ort/ | ||
cp ~/onnxruntime/build/Linux/Release/libonnxruntime*.so* src/ort/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
#include <vector> | ||
|
||
#ifndef USE_CXX17 | ||
#include <span> | ||
#else | ||
namespace std { | ||
|
||
template <typename T> | ||
struct span { | ||
span() = default; | ||
span(T* p, size_t length) : p_{p}, length_{length} {} | ||
|
||
span(const span<std::remove_const_t<T>>& s) : p_{const_cast<T*>(s.data())}, length_{s.size()} {} | ||
span(std::vector<std::remove_const_t<T>>& s) : p_{const_cast<T*>(s.data())}, length_{s.size()} {} | ||
|
||
bool empty() const { return length_ == 0; } | ||
|
||
size_t size() const { return length_; } | ||
size_t size_bytes() const { return length_ * sizeof(T); } | ||
|
||
T* data() { return p_; } | ||
const T* data() const { return p_; } | ||
|
||
T& operator[](size_t index) { return p_[index]; } | ||
|
||
T& back() { return p_[length_ - 1]; } | ||
T back() const { return p_[length_ - 1]; } | ||
|
||
T* begin() { return p_; } | ||
T* end() { return p_ + length_; } | ||
|
||
span subspan(size_t index, size_t length) { return span(p_ + index, length); } | ||
span<const T> subspan(size_t index, size_t length) const { return span(p_ + index, length); } | ||
|
||
private: | ||
T* p_{}; | ||
size_t length_{}; | ||
}; | ||
} // namespace std | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters