Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this in vs 2017 and win10 64bit #4

Open
superskhm opened this issue Jul 9, 2020 · 3 comments
Open

How to use this in vs 2017 and win10 64bit #4

superskhm opened this issue Jul 9, 2020 · 3 comments

Comments

@superskhm
Copy link

No description provided.

@monchin
Copy link

monchin commented Aug 7, 2020

Recently I'm doing this thing, but VS2019 instead of 2017.

Basically you need to follow this tutorial. After successfully installation, you should be able to run samples in C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.0(Notice that C:\PrgramData is defaultly a hidden folder). Note each sample has different VS versions including 2017 and 2019.

If you can run samples successfully, you can compile this library. You need to create a new project with CUDA 11.0 Runtime template. Then you should copy all the source codes here to your new project. You need to add some codes, for example,

#ifdef _MSC_VER 
//not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#define uint unsigned int
#define __intptr_t intptr_t
#endif

You need to add these codes in the right head files to ensure all the codes could be compiled correctly.

Then, as MSVC can't compile C array with variable length, you must change some C arrays to std::vector(std::vector<int>a(length+1); auto ptr_a = a.data()).

Also, you need to open property of this project, and in linker->input->additional dependencies(may be other words because I translated from Chinese), you must add cublas.lib;cuda.lib;cudadevrt.lib;cudart.lib;OpenCL.lib;

Then, I guess you can compile it successfully. Enjoy!

@superskhm
Copy link
Author

can you share it with us? Following your suggestion, I can compile it. But I can't get the right result, i get a blank image.

@monchin
Copy link

monchin commented Sep 15, 2020

can you share it with us? Following your suggestion, I can compile it. But I can't get the right result, i get a blank image.

That is strange. I used this package's lena.dat in test dir, and ran the main function, and I successfully got res.dat as the result. You can try lena first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants