Results 1 to 2 of 2

Thread: arbitrary size matrix multiplication

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    2

    arbitrary size matrix multiplication

    Does anyone know a fast arbitrary size matrix multiplication algorithm/code on GPU?

    The matrix multiplication from NVIDIA SDK seems only work when input matrix has a size of multiple of 16. For example, if input matrix is 127X127, it returns wrong results.

  2. #2
    Junior Member
    Join Date
    Feb 2013
    Posts
    4

    Re: arbitrary size matrix multiplication

    I assume that what you are doing is having each thread or work-item calculate one item in the resulting matrix. Most of my GPU coding experience is from CUDA, I am still getting used to the OpenCL terminology, the terms I use in my answer may reflect that.

    There are a two things you can do to manipulate the example to other sized matrices.
    1) Have the current thread check if it is in the bounds of the resulting matrix, if not have it exit.
    2) Pad your matrices to be a multiple of the blocksize

    Hope that helps!

Similar Threads

  1. Matrix multiplication question
    By BKB in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 1
    Last Post: 08-23-2011, 02:32 AM
  2. Matrix Multiplication
    By wrx in forum OpenCL
    Replies: 18
    Last Post: 02-17-2011, 01:24 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
  •