I want to use Boost with Cuda on WIN VC++.
but it is so difficult to me. :<
for example, I wrote this simple cuda code
#include <iostream>
#include <helper_functions.h>
#include <helper_cuda.h>
#include <boost/filesystem.hpp>
#define N 10
__global__
void
add(int *a, int *b, int *c) {
int tid=blockIdx.x;
if(tid<N)
c[tid]=a[tid]+b[tid];
}
int main() {
int a[N], b[N], c[N];
int *dev_a, *dev_b, *dev_c;
cudaMalloc((void**)&dev_a, N*sizeof(int));
cudaMalloc((void**)&dev_b, N*sizeof(int));
cudaMalloc((void**)&dev_c, N*sizeof(int));
for(int i=0; i<N; i++) {
a[i]=-i;
b[i]=i*i;
}
cudaMemcpy(dev_a, a, N*sizeof(int), cudaMemcpyHostToDevice);
cudaMemcpy(dev_b, b, N*sizeof(int), cudaMemcpyHostToDevice);
add<<<N, 1>>>(dev_a, dev_b, dev_c);
cudaMemcpy(c, dev_c, N*sizeof(int), cudaMemcpyDeviceToHost);
for(int i=0; i<N; i++) {
printf("%d+%d=%d\n", a[i], b[i], c[i]);
}
cudaFree(dev_a);
cudaFree(dev_b);
cudaFree(dev_c);
return 0;
}
in this code I just include 1 boost library.
boost/filesystem.hpp
then this code shows me these error messages
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(193): error : expected either a definition or a tag name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(194): error : expected an identifier
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(194): error : expected a ";"
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(219): error : identifier "copy_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(380): error : identifier "copy_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(384): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(387): error : identifier "copy_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(391): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(730): error : expected either a definition or a tag name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(731): error : expected an identifier
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(731): error : expected a ";"
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(736): warning : parsing restarts here after previous syntax error
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(739): error : nonmember operator requires a parameter with class or enum type
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(748): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(750): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(766): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(766): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(767): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(778): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(778): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(846): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(846): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(856): error : identifier "symlink_option" is undefined
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(846): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(870): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(897): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(898): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(918): error : name followed by "::" must be a class or namespace name
1>C:\boost_1_54_0\boost/filesystem/operations.hpp(920): error : name followed by "::" must be a class or namespace name
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 5.0.targets(592,9): error MSB3721: ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" --keep-dir "x64\Release" -maxrregcount=0 --machine 64 --compile -DWIN32 -DNDEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MD " -o "x64\Release\main.cu.obj" "D:\cache\implement\physikum\physikum\src\bin\cuda_test\main.cu""
please, If you know the solution of this problem, teach me How to solve this…
thank you. :)