Results 1 to 2 of 2

Thread: How to use C++ templates in kernel?

  1. #1
    Junior Member
    Join Date
    Dec 2010

    How to use C++ templates in kernel?

    I'm a novice in OpenCL.

    I have an algorithm which uses templates and now I need to rewrite it to use OpenCL.
    Is there any way to use C++ templates in kernel?

    Is it possible to somehow expand templates by C++ compiler or some tool and after that use so changed kernel function?

  2. #2
    Join Date
    Oct 2010
    Vancouver, Canada

    Re: How to use C++ templates in kernel?

    It will depend on how templates are being used. You may be able to replace some simple uses with preprocessor #defines. Long ago there used to be a tool called CFront that was the C++ compiler and it translated to C rather than compiling directly to an ISA... I've never gone looking for whether somebody has been keeping it alive. Other than that, you're facing doing the task by hand, I'm afraid.

Similar Threads

  1. Templates support
    By IvanK in forum OpenCL
    Replies: 4
    Last Post: 04-15-2013, 09:53 AM
  2. Replies: 4
    Last Post: 08-06-2012, 01:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean