Results 1 to 3 of 3

Thread: How Can i work with matrix inside a kernel?

  1. #1

    How Can i work with matrix inside a kernel?

    Hi,

    If i allocate a matrix outside kernel, how can i work with it inside of kernel, since i can't work with pointer-to-pointer?


    Thanks,

  2. #2
    Junior Member
    Join Date
    Sep 2011
    Location
    Kingisepp, Russia
    Posts
    11

    Re: How Can i work with matrix inside a kernel?

    Quote Originally Posted by luizdrumond
    Hi,

    If i allocate a matrix outside kernel, how can i work with it inside of kernel, since i can't work with pointer-to-pointer?


    Thanks,
    Hm... For example, I started using one-dimensional array. And the one-dimensional array uses less memory, because there are no pointers.

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Location
    Kingisepp, Russia
    Posts
    11

    Re: How Can i work with matrix inside a kernel?

    Even in Nvidia examples, uses one-dimensional array:
    Code :
    /*
     * Copyright 1993-2010 NVIDIA Corporation.  All rights reserved.
     *
     * Please refer to the NVIDIA end user license agreement (EULA) associated
     * with this source code for terms and conditions that govern your use of
     * this software. Any use, reproduction, disclosure, or distribution of
     * this software and related documentation outside the terms of the EULA
     * is strictly prohibited.
     *
     */
     
    /* Matrix multiplication: C = A * B.
     * Device code.
     */
     
    #define AS(i, j) As[j + i * BLOCK_SIZE]
    #define BS(i, j) Bs[j + i * BLOCK_SIZE]

Similar Threads

  1. Replies: 4
    Last Post: 08-06-2012, 01:18 AM
  2. Replies: 3
    Last Post: 03-24-2010, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •