diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..4bfa2c1 --- /dev/null +++ b/.clang-format @@ -0,0 +1,3 @@ +BasedOnStyle: LLVM +IndentWidth: 4 +AccessModifierOffset: -4 \ No newline at end of file diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..9fddeb6 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,11 @@ +Checks: '-*,clang-diagnostic-*,misc-*,performance-*,clang-analyzer-*,bugprone-*' +CheckOptions: + - { key: readability-identifier-naming.NamespaceCase, value: lower_case } + - { key: readability-identifier-naming.ClassCase, value: CamelCase } + - { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ } + - { key: readability-identifier-naming.StructCase, value: CamelCase } + - { key: readability-identifier-naming.FunctionCase, value: lower_case } + - { key: readability-identifier-naming.VariableCase, value: lower_case } + - { key: readability-identifier-naming.MemberCase, value: lower_case } + - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } + - { key: readability-simplify-boolean-expr, value: true } diff --git a/README.md b/README.md index 5db997b..e970163 100644 --- a/README.md +++ b/README.md @@ -24,25 +24,22 @@ # Backends -- [ ] Generic (already implemented but mixed up with AVX2 backend) -- [X] AVX2 (going to be replaced by ISPC) -- [X] CUDA (wip, some kernels are missing) -- [ ] SYCL ? HIP ? Vulkan ? +- [X] ISPC +- [X] CUDA # Maintainability - [X] Clangd -- [ ] Clang-Tidy +- [X] Clang-Format +- [X] Clang-Tidy - [X] Testing framework (via `xmake test`) - [X] Compilation CI -- [ ] Performance regression CI - [ ] Documented code (doxygen style) ## Build and run Requirements: - Windows (MSVC compiler) or Linux (GCC or Clang) -- CPU that supports AVX2 - [xmake](https://xmake.io/#/) build system - For Windows, the [installer](https://github.com/xmake-io/xmake/releases) is recommended - For Linux, run `curl -fsSL https://xmake.io/shget.text | bash` diff --git a/vlm/backends/cuda/src/vlm_backend_cuda.cu b/vlm/backends/cuda/src/vlm_backend_cuda.cu index e9b35fa..302464e 100644 --- a/vlm/backends/cuda/src/vlm_backend_cuda.cu +++ b/vlm/backends/cuda/src/vlm_backend_cuda.cu @@ -97,12 +97,11 @@ public: cudaStream_t stream() {return(m_stream);} cublasHandle_t cublas() {return(m_cublas);} -protected: +private: cusolverDnHandle_t m_cusolver = nullptr; cudaStream_t m_stream = nullptr; cublasHandle_t m_cublas = nullptr; - -private: + CtxManager() = default; ~CtxManager() = default; };