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 9120757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:41:44+00:00 2026-06-17T05:41:44+00:00

As the cutil.h header is removed from CUDA Samples, some new headers are introduced

  • 0

As the cutil.h header is removed from CUDA Samples, some new headers are introduced like helper_cuda.h, helper_functions.h.

One of the main keywords that is used by me was CUDA_CHECK_ERROR, and I think it is replaced with checkCudaErrors.

In most of my code the macro compiles and works well. However when I use it in a class which has a function named check(..), checkCudaErrors function gives compile errors.

Here is an example:

#include <stdio.h>

#include <cuda_runtime.h>
#include <helper_cuda.h>
#include <helper_functions.h>

template<typename T>
class Trivial {

public:

    void check()
    {

    }

    void initialize() 
    {
        checkCudaErrors(cudaMalloc(NULL, 1));
    }

    T val;

};

int main(int argc, char **argv)
{

    Trivial<int> tt;

    tt.initialize();

    return 0;
}

and the result of compilation: (the same error is seen when compiled with GCC 4.5 also!)

1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
2>------ Build started: Project: massivecc, Configuration: Release x64 ------
2>  trivial_main.cpp
2>..\src\trivial_main.cpp(19): error C2660: 'Trivial<T>::check' : function does not     take 4 arguments
2>          with
2>          [
2>              T=int
2>          ]
2>          ..\src\trivial_main.cpp(18) : while compiling class template member         function 'void Trivial<T>::initialize(void)'
2>          with
2>          [
2>              T=int
2>          ]
2>          ..\src\trivial_main.cpp(29) : see reference to class template         instantiation 'Trivial<T>' being compiled
2>          with
2>          [
2>              T=int
2>          ]
3>------ Skipped Build: Project: ALL_BUILD, Configuration: Release x64 ------
3>Project not selected to build for this solution configuration 
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 1 skipped ==========

The same error is taken when I removed the template parameter.

  • 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-06-17T05:41:45+00:00Added an answer on June 17, 2026 at 5:41 am

    I had to copy the check(..) function’s definition from helper_functions.h into my class’s header to be able to compile the class.

    #include <stdio.h>    
    #include <cuda_runtime.h>
    #include <helper_cuda.h>
    #include <helper_functions.h>    
    class Trivial {    
    public:    
        template< typename T >
        bool check(T result, char const *const func, const char *const file, int const line)
        {
            if (result) {
                fprintf(stderr, "CUDA error at %s:%d code=%d(%s) \"%s\" \n",
                file, line, static_cast<unsigned int>(result), _cudaGetErrorEnum(result), func);
                return true;
            } else {
                return false;
            }
        }
    
        void check() {  }
    
        void initialize() 
        {
            checkCudaErrors(cudaMalloc(NULL, 1));
        }
    };
    
    int main(int argc, char **argv)
    {
        Trivial tt;
        tt.initialize();    
        return 0;
    }
    

    So, this mainly solved my problem and my code compiled successfully.

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

Sidebar

Related Questions

Good day. I'm new to C# and trying to call functions from a DLL
all I referred to simpleMultiCopy.cu in CUDA SDK 4.0 and wrote one, see code
I want to compile an old project (based on CUDA 2.3) with the new
I got the message: cutilCheckMsg() CUTIL CUDA error : kernel launch failure : CUDA
While building my CUDA project I get the following error: cutil_inline_runtime.h(328): error: identifier CURAND_STATUS_DOUBLE_PRECISION_REQUIRED
like this is my form's select box <select name=cutid onchange=findcustid(this.value)> <option value=1001>cust 1</option> <option
How to recognise the text from handwriting? I tried teseract libraries (version 2) but
I am tryint to integrate CUDA in an existing project, in which several libs
How to change form with animation(like fading,Cutl Up,...) in win application? I have two
I have this c++ project in which I call a cuda kernel by means

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.