Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jagot/cxxblas
https://github.com/jagot/cxxblas
blas cblas lapack lapacke
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jagot/cxxblas
- Owner: jagot
- Created: 2017-03-03T11:19:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-07T13:56:58.000Z (almost 8 years ago)
- Last Synced: 2024-11-15T18:35:01.818Z (2 months ago)
- Topics: blas, cblas, lapack, lapacke
- Language: CMake
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+TITLE: CXXBLAS
#+AUTHOR: Stefanos Carlström
#+EMAIL: [email protected]* Introduction
C++ (header-only) templated wrappers around CBLAS/LAPACKE.
Tested with OpenBLAS on Linux and Accelerate on macOS.* Example usage
scale.cpp:
#+BEGIN_SRC C++
#include "cxxblas.h"
#include
#include
#includetemplate
void pvec(const std::vector& v)
{
std::cout << "[";
for(const auto &e : v)
std::cout << e << " ";
std::cout << "]" << std::endl;
}int main(int argc, char* argv[])
{
int n = 10;
std::vector> x(n, {0.0, 1.0});pvec(x);
cxxblas::scale(5.0, x);
pvec(x);return 0;
}
#+END_SRCCMakeLists.txt:
#+BEGIN_SRC cmake
cmake_minimum_required(VERSION 3.6)
project(meff)# Or wherever cxxblas cmake directory is to be found
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cxxblas/cmake")
include(CXXBLAS)add_executable(scale scale.cpp)
target_link_libraries(scale ${CXXBLAS_LIBRARIES})
#+END_SRCOutput:
#+BEGIN_EXAMPLE
[(0,1) (0,1) (0,1) (0,1) (0,1) (0,1) (0,1) (0,1) (0,1) (0,1) ]
[(0,5) (0,5) (0,5) (0,5) (0,5) (0,5) (0,5) (0,5) (0,5) (0,5) ]
#+END_EXAMPLE