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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:53:29+00:00 2026-05-13T05:53:29+00:00

I am tryint to integrate CUDA in an existing project, in which several libs

  • 0

I am tryint to integrate CUDA in an existing project, in which several libs (DLLs) are created. I started with a very simple kernel that computes a dot product :

// dotProd_kernel.cu

__global__ void dotProd( double* result, double* vec1, double* vec2)
{
    int i = threadIdx.x;
 result[i] = vec1[i] * vec2[i];
}

This kernel is called by a host script :

// doProd.cu

#include <cutil_inline.h>
#include <dotProd_kernel.cu>

extern "C" double CUDA_dot(THTensor *vec1, THTensor *vec2);

double CUDA_dot(THTensor *vec1, THTensor *vec2)
{
    // [content skipped]    

    // execute the kernel
    dotProd<<< 1, nbThreads >>>(device_vec1, device_vec2, device_result_array);

    // [content skipped]

    return sum;
}

I generate build files using cmake, and use Visual Studio 2008 Pro to compile it. If I simply use a .cu file with a foobar function that calls no kernel, it executes fine. But with the above code, I get the following error :

c:\cuda\include\math_functions.h(3459) : error C2491: 'log1p' : definition of dllimport function not allowed

The resulting code that calls the CUDA code is exported as a DLL. Is this the problem ?

  • 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-13T05:53:29+00:00Added an answer on May 13, 2026 at 5:53 am

    Actually, the CUDA library defines the log1p function, and so was an obscure part of the code I’m trying to add CUDA to. Thus, there was some kind of conflict between the two. I simply renamed the function in my code, and it worked !

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

Sidebar

Related Questions

I am currently trying to integrate Paypal's MECL in an already existing IOS project
I have a large project in C and i'm trying to integrate some Cuda
I'm trying to integrate CUDA to an existing aplication wich uses boost::spirit. Isolating the
Im trying to integrate Brad Larson's GPUImage framework to my project. The sample code
I am trying to integrate a simple login for my site with php. i
I'm trying to integrate FNV hashing algorithm on a PHP-based project as part of
I'm trying integrate spring with hibernate but catch exception on project start. Caused by:
Problem I'm trying to create an CUDA application that is well integrated with .net.
I'm trying to integrate sitemesh into my struts2 app, but i'm finding that it's
I am trying to integrate refinerycms with my existing rails app and i want

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.