Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7698287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:12:24+00:00 2026-05-31T22:12:24+00:00

My setup for CUDA Visual Studio 2010 and 2008 SP1 (required by CUDA). Parallel

  • 0

My setup for CUDA

Visual Studio 2010 and 2008 SP1 (required by CUDA).
Parallel NSight 1.51
CUDA 4.0 RC or 3.2 and Thrust

Basically, i followed the guide on:
http://www.ademiller.com/blogs/tech/2011/03/using-cuda-and-thrust-with-visual-studio-2010/

I then proceeded to compile successfully without error messages.

So i tried with more CUDA code examples from the web. These errors surfaced on Visual Studios. I can still compile successfully without error messages but these errors are only visually highlighted

  • “Error:identifer “blockIdx” is undfined.”
  • “Error:identifer “blockDim” is undfined.”
  • “Error:identifer “threadIdx” is undfined.”

Here’s the screenshot.

https://i.stack.imgur.com/v1LFx.png

Should i be concerned? Is it a Visual Studios bug or is my setup configuration wrong? Any help is appreciated. Thanks guys!

P.S I’m very new to both Visual Studios and CUDA.

// incrementArray.cu
#include "Hello.h"
#include <stdio.h>
#include <assert.h>
#include <cuda.h>
void incrementArrayOnHost(float *a, int N)
{
  int i;
  for (i=0; i < N; i++) a[i] = a[i]+1.f;
}
__global__ void incrementArrayOnDevice(float *a, int N)
{
  int idx = blockIdx.x*blockDim.x + threadIdx.x;
  if (idx<N) a[idx] = a[idx]+1.f;
}
int main(void)
{
  float *a_h, *b_h;           // pointers to host memory
  float *a_d;                 // pointer to device memory
  int i, N = 10;
  size_t size = N*sizeof(float);
  // allocate arrays on host
  a_h = (float *)malloc(size);
  b_h = (float *)malloc(size);
  // allocate array on device 
  cudaMalloc((void **) &a_d, size);
  // initialization of host data
  for (i=0; i<N; i++) a_h[i] = (float)i;
  // copy data from host to device
  cudaMemcpy(a_d, a_h, sizeof(float)*N, cudaMemcpyHostToDevice);
  // do calculation on host
  incrementArrayOnHost(a_h, N);
  // do calculation on device:
  // Part 1 of 2. Compute execution configuration
  int blockSize = 4;
  int nBlocks = N/blockSize + (N%blockSize == 0?0:1);
  // Part 2 of 2. Call incrementArrayOnDevice kernel 
  incrementArrayOnDevice <<< nBlocks, blockSize >>> (a_d, N);
  // Retrieve result from device and store in b_h
  cudaMemcpy(b_h, a_d, sizeof(float)*N, cudaMemcpyDeviceToHost);
  // check results
  for (i=0; i<N; i++) assert(a_h[i] == b_h[i]);
  // cleanup
  free(a_h); free(b_h); cudaFree(a_d); 

  return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:12:25+00:00Added an answer on May 31, 2026 at 10:12 pm

    It’s just a keyword Visual Intellisense problem conducted by VS itself. Codes can be built successfully because VS requests NVCC, who can find and recognize these keywords, to do the building work, you can just add the following code to solve this problem under VS2010

     #include "device_launch_parameters.h"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Setup project with Visual studio 2008 really sucks. Do you know if there is
I've got a couple of Parallel Nsight compatible CUDA GPU's. The second (lower) one
Setup I'm writing a script to process and annotate build logs from Visual Studio.
Setup TFS 2010 on a pretty oldish server (actually an oldish desktop machine running
Direct Question: How do I create a simple hello world CUDA project within visual
Setup: IIS on Windows 2008 Server R2 Enterprise, SQL Server 2008 R2 Enterprise, ASP.NET
I just set up the Parallel Nsight debugging environment and started remote debugging my
Setup Have you ever had the experience of going into a piece of code
Setup I have a website that draws RSS feeds and displays them on the
Setup is following: Drupal project, one svn repo with trunk/qa/production-ready branches, vhosts for every

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.