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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:36:23+00:00 2026-05-24T08:36:23+00:00

Following the post , if I have header file,which has some functions implementations in

  • 0

Following the post ,
if I have header file,which has some functions implementations in it and should be included in several kernels(I mean these function are auxilary in all kernels and I don`t want to duplicate the code)

How I make this inclusion – can I keep the functions in header?Will the kernels and the header functions be compiled?

Can you specify (maybe by example) how I use the "-I" option in these case?
I am using VS2010(if its matter at all)

Note:Each kernel runs in different program

  • 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-24T08:36:24+00:00Added an answer on May 24, 2026 at 8:36 am

    Yes, you can use headers in OpenCL for exactly what you are suggesting. Each kernel file will include the header and compile it.

    The “-I” option is only used to specify the path for includes. If your includes are in your working directory it is not necessary. Here is an example:

    /////////////////////////////////////////////////////////////////
    // Load CL file, build CL program object, create CL kernel object
    /////////////////////////////////////////////////////////////////
    std::string  sourceStr = FileToString(params.kernelFile);
    
    cl::Program::Sources sources(1, std::make_pair(sourceStr.c_str(), sourceStr.length()));
    cl::Program program = cl::Program(oclHandles.context, sources);
    
    program.build(oclHandles.devices,"-I c:/Includes/");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which works just fine when the method is POST,
I have the following piece of code which replaces template markers such as %POST_TITLE%
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
Let's say I have the following jQuery AJAX call: $.ajax({ type: POST, url: MyUrl,
I have the following code: <script type=text/javascript> $(document).ready(function() { $(#Save).click(function() { $.post(url, { data:
I have a custom Http Handler which manipulates HTTP POST and GET. I got
I have the following code to show the gravatar of a post author, but
http://lakers.sonikastudios.com/gallery/sample-gallery-post-1/ That post has several pages using the quicktag of Wordpress. This post is
I have the following SOAP message that i want to post it to my

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.