Results 1 to 2 of 2

Thread: Right tool for the job

  1. #1
    Newbie Newbie
    Join Date
    Oct 2017

    Right tool for the job

    Hi everyone! I am new to the Khronos community and would like some insight on Open*L languages before I dive into the details.

    I am currently developing a simulation using MATLAB -- this is the tool will be used in -- and would like to offload part of the simulation to the GPU. Although I have experience with CUDA C, which is more natively supported by the platform, portability is key and the tool must be able to run on non-Nvidia gpu's as well(Mostly Intel's integrated gpu's). Linking C code to matlab is however quite trivial, and so I wanted to use either OpenCL or OpenGL for the job.

    The computations required to be run on the GPU are quite simple, and I think using either should be able to perform the required computations. My question is which one is easiest to learn/implement. An overview of the necessary computations(without going into detail):

    Code :
    let v_a be an array containing ~1E4 floats
    let v_b be an array containing ~20 floats
    let v_r be an array containing ~1E4 floats
    let m_a be a 2d array containing ~20*1E4 floats
    let m_b be a 2d array containing ~20*1E4 floats
    let m_c be a 2d array containing ~20*1E4 floats
    let f(x) be a trigonometric function
    for (int i=0;i<20;i++){
        m_a(i,:) = v_a + s(i); // each row in m_a equals the vector v_a plus a float
    m_b = m_c*f(m_a); // apply function to each element in matrix m_a and do pointwise multiplication between result and m_c
    v_r = sum(m_b, 1); // sum over first dimension of matrix

    What do you guys think the way is to go? I have no experience with either. Thank you very much for reading my post; I would really appreciate advice on the matter!

    Kind regards,

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2015
    if you've written mex functions, opencl mex is not too different from a cuda mex.

Similar Threads

  1. Tool like RenderMonkey
    By myk45 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-10-2012, 05:12 AM
  2. any tool for opengl es
    By freesui1984 in forum OpenGL ES
    Replies: 2
    Last Post: 09-18-2008, 06:45 PM
  3. Tool
    By imported_Groovounet in forum OpenGL: General
    Replies: 5
    Last Post: 05-16-2006, 11:27 AM
  4. 3D Tool
    By wis mak in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 11-12-2002, 08:01 PM
  5. Modelling tool
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-09-2002, 08:11 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