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

  • SEARCH
  • Home
  • 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 4343998
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:50:01+00:00 2026-05-21T11:50:01+00:00

I have the following source file (CUDA_Integral_Image.cu) for a class of the same name:

  • 0

I have the following source file (CUDA_Integral_Image.cu) for a class of the same name:

#include "cuda_runtime.h"
#include "npp.h"
#include "CUDA_Integral_Image.h"
#include <stdlib.h>
#include <time.h>

...

// allocated device source image
int step = width;
Npp8u* pSI = nppiMalloc_8u_C1(width, height, &step);
// copy test image up to device
cudaMemcpy2D(pSI, width, pHI, width, width, height, cudaMemcpyHostToDevice);
// allocate device result images
Npp32s* pDi = nppiMalloc_32s_C1(width,height,width*sizeof(int)); // LINE 30

Attempting to compile this code results in:

.../CUDA_Integral_Image.cu(30): error : unrecognized token
1>  
.../CUDA_Integral_Image.cu(30): error : expected an identifier
1>  
.../CUDA_Integral_Image.cu(30): error : unrecognized token
1>  
.../CUDA_Integral_Image.cu(30): error : expected an expression

There are no other header files included in CUDA_Integral_Image.h. All the NPP dependencies (.h and lib) seem to be added without problems. Furthermore, Npp8u* and nppiMalloc_8u_C1 are recognized just fine. I have absolutely no idea what could be causing this error.

..if I change the code to:

Npp32s* pDi; // LINE 30
pDi = nppiMalloc_32s_C1(width,height,width*sizeof(int));

I get the errors:

.../CUDA_Integral_Image.cu(30): error : unrecognized token
1>  
.../CUDA_Integral_Image.cu(30): error : expected an identifier
1>  
.../CUDA_Integral_Image.cu(31): error : identifier "pDi" is undefined
1>  
.../CUDA_Integral_Image.cu(31): error : unrecognized token
1>  
.../CUDA_Integral_Image.cu(31): error : expected an expression

No idea what could be causing this, would appreciate any suggestions!

  • 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-21T11:50:01+00:00Added an answer on May 21, 2026 at 11:50 am

    The last argument to nppiMalloc_32s_C1 is incorrect. It should always be a pointer to an integer variable. The routine internally calculates the correct size for the allocation (include alignment) and returns the size to the caller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

gcc 4.4.3 c89 I have the following source file. However, I get a stack
I have the following file How to remove by sed all FILE NAME lines
I have the following source code : // main.cpp #include a.h int main() {
Let's say I have following typed in my source file. var myFunction = function()
I am new to JQuery and I have the following issue: Source file: function
I have the following source code in main.cpp: #include <iostream> #include <iomanip> int main()
Suppose I have the following defined in a header file: namespace MyNamespace { Class
The Background I have the following source code #include <libubuntuone-1.0/u1-music-store.h> #include <libsyncdaemon-1.0/libsyncdaemon/libsyncdaemon.h> static void
I have written the following Java source file ( Hello.java ): package com; public
I have the following method of copying files: public static void nioCopy(File source, File

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.