1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

C++ で numpy っぽく書いて GPU-accelerated 処理できる MatX のメモ

Last updated at Posted at 2022-02-15

背景

numpy 便利よね. Python(e.g. pytorch, jax, cupy) で fft とか svd とかやっている...
しかし GPU 処理しても, いまいち性能でなかったり, 大きめデータだとメモリ不足(メモリを無駄につかう)になってつらい...

GPU + C++ でやりたいけどコード書くのめんどい...

いつの間にか MatX が出てました.

fft や svd など俺得関数対応していてよい!
(CPU 実行もあるよ)

ビルド

Ubuntu 20.04 あたり使っていれば compiler は特には問題ないですが, cmake が 3.18 or later を必要とします.
Ubuntu 20.04 ですと snap で cmake 入れるとよいでしょう.

CUDA は 11 or later のみ対応です. CUDA 10 は対応していませんので注意です!

ユニットテスト

Unit test では python 環境に numpy, scipy, cupy が入っている必要があります.

自前アプリに組み込む

cmake add_subdirectory でいけるようになっています.

TODO

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?