Author |
Topic |
|
Matthew
New Member
3 Posts |
Posted - Jun 29 2011 : 05:48:06 AM
|
I would really like to see Visual Assist support CUDA. By this, I don't just mean making Visual Assist active on *.cu and *.cuh files, as described in http://docs.wholetomato.com?W328. What I would like is to have Visual Assist refactoring tools like "rename variable" work in .cu files (which they currently do not, even if you make it active on these extensions).
Although I realise that only a minority of Visual Assist users write CUDA, for those that do I think this would be a really useful extension - is it one you are willing to consider?
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jun 29 2011 : 09:20:12 AM
|
We have enough on our plate supporting current languages, so this is unlikely. However, I have put in a feature request to see what the developers make of it:
case=58450 |
|
|
sunsetquest
New Member
3 Posts |
Posted - Jul 03 2011 : 5:51:32 PM
|
I would also like to see this also. Cuda is very close to c++ but has some added keywords.
I followed this the instructions here: http://forums.nvidia.com/index.php?showtopic=183346 and they work pretty good. Visual Assist is still very helpfull even though it does not fully support it.
Mainly, Visual assist does not understand... __device__ (function type type specifier) __global__ (function type specifier) blockIdx.x (built in variable) threadIdx.x (built in variable) __shared__ (memory type specifier)
Mostly if there was a way for visual assist to just ignore __shared__, __global__, and __device__ and treat blockIdx.x and threadIdx.x as constants that would be really helpful.
|
|
|
sunsetquest
New Member
3 Posts |
|
gmit
Whole Tomato Software
Croatia
90 Posts |
Posted - Jul 04 2011 : 3:09:58 PM
|
Personally, I don't use CUDA or modify Visual Assist X\\Misc\\StdAfx.h file, but, you might try to add to the VA's stdafx.h something like:
#define __device__ struct __blockIdx { int x; int y; }; #define blockIdx (*(__blockIdx *)0)
|
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jul 04 2011 : 6:27:00 PM
|
I was going to recommend something similar. More info about this stdafx.h:
http://docs.wholetomato.com?W302
Anyway, the same applies to __global__ and __shared__ so you can extend gmit's list with 2 more lines
#define __global__ #define __shared__ |
|
|
Matthew
New Member
3 Posts |
Posted - Jul 05 2011 : 05:40:06 AM
|
I had tried this with no success, but I just tried again, including some extra symbols:
#define __launch_bounds__(x) #define __restrict__ struct blockDim{ int x; int y; }
Now the re factoring tools work! The thing is, I then tried to find out which extra definition had fixed the issues I was seeing, and removed them one by one. Visual Assist still worked without any of them, so I think what I've actually discovered is that I messed something up the first time I tried this .
If you could consider including these StdAfx definitions and registry definitions in the next Visual Assist release, I wouldn't get a chance to foul things up while manually following the instructions on the forums... |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jul 05 2011 : 10:38:43 AM
|
Thank you for the update. I'm glad you made progress, especially because of the refactoring. We will consider improving this via VA's stdafx.h. I have updated the case with your experiences. |
|
|
sunsetquest
New Member
3 Posts |
Posted - Jul 13 2011 : 01:56:06 AM
|
Thank you everyone for your help. I did what was suggested and Visual Assist works even better now! I no longer get any annoying squiggly lines under some of the keywords in .cu files for __device__ and __global__ functions. Also, it works a little better now. Below are some instructions I made to summarize what everyone said here and in topic 5956.
================================================================== To help make it so Visual Assist X does not fail with cuda and underline cuda keywords correctly, perform the following: ==================================================================
1) copy C:\\Program Files\\Visual Assist X\\Misc\\StdAfx.h to C:\\Users\\RWHITE\\AppData\\Roaming\\VisualAssist\\ Misc\\StdAfx.h 2) Then insert the following in to C:\\Users\\RWHITE\\AppData\\Roaming\\VisualAssist\\Misc\\StdAfx.h ///////////////////////////////////////////////////////////// ////////////////// // macro for visual assist compatibility with cuda #define __launch_bounds__(x) #define __restrict__ #define __device__ #define __global__ #define __shared__ #define __constant__ struct int3{ int x; int y; int z; }; struct uint3{ unsigned int x; unsigned int y; unsigned int z; }; struct blockIdx{ int x; int y; int z; }; struct threadIdx{ unsigned int x; unsigned int y; unsigned int z; }; struct blockDim{ int x; int y; int z; }; struct blockIdx{ int x; int y; int z; }; typedef int warpSize; 3) Lastly, Open Visual studio and run from the menu: VA Options -> Performance -> General -> Rebuild symbol databases
4) "Note that you might also want to go into the VA settings->Projects->C/C++ Directories, switch to "Custom" Platform mode, and add your <CUDA Install PATH>/inc directory to the list of search directories." (From Mark Harris;http://forums.nvidia.com/index.php?showtopic=53690) 5)Lastly, add the .cu extension using this topic: http://docs.wholetomato.com?W328. ================================================================== Sources ================================================================== -This post. -docs.wholetomato.com?W328 -Mark Harris;http://forums.nvidia.com/index.php?showtopic=53690
|
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jul 13 2011 : 11:02:33 AM
|
Thank you very much for the summary, I am sure this will be very helpful next time someone is trying to improve support for CUDA |
zen is the art of being at one with the two'ness |
|
|
KindDragon
New Member
Russia
6 Posts |
Posted - Sep 10 2011 : 06:07:21 AM
|
quote: 4) "Note that you might also want to go into the VA settings->Projects->C/C++ Directories, switch to "Custom" Platform mode, and add your <CUDA Install PATH>/inc directory to the list of search directories." (From Mark Harris;http://forums.nvidia.com/index.php?showtopic=53690)
Better use path %CUDA_INC_PATH% |
|
|
|
Topic |
|