How could I compile with cuda/thrust library in cudamex?

3 ビュー (過去 30 日間)
wei zhang
wei zhang 2021 年 2 月 22 日
回答済み: wei zhang 2021 年 7 月 8 日
Hi, I am trying to build a mex with thrust library with the below code. I got an error.
C:\Program Files\MATLAB\R2020b\extern\include\tmwtypes.h(815): fatal
error C1189: #error: "This code must be compiled using a 2's
complement representation for signed integer values"
How to correct the error? Is there any thrust library example in Matlab?
% compile command
src = 'test.cu';
path1 =['-I' fullfile(cudaPath,'include\thrust')];
mexcuda(path1,src);
% mex(path1,src);
test.cu
#include "mex.h"
#include <thrust/device_vector.h>
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
mxDouble *key = mxGetPr(prhs[0]);
size_t N1 = mxGetM(prhs[0]);
thrust::device_vector<int> d_a(key, key + N1);
}
(After searching on the internet, I found Matlab seems not support library thrust unfortunately.)
  1 件のコメント
wei zhang
wei zhang 2021 年 2 月 24 日
It seems matlab not supported thrust library as I searched on the internet.

サインインしてコメントする。

採用された回答

wei zhang
wei zhang 2021 年 7 月 8 日
The example could run well since 2021a.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by