Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Full CUDA support

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Matthew 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?
10   L A T E S T    R E P L I E S    (Newest First)
KindDragon 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%
feline 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
sunsetquest 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

accord 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.
Matthew 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 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__
gmit 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)
sunsetquest Posted - Jul 03 2011 : 5:56:49 PM
sorry, wrong link: http://forums.nvidia.com/index.php?showtopic=53690
sunsetquest 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.

accord 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

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000