Menu

#446 OpenCL acceleration for PART primitive

Incomplete
closed-accepted
None
5
2016-06-20
2016-06-06
Param Hanji
No

OpenCL code for PART. As usual, the GPU generated png as well as the diff file are attached.

2 Attachments

Related

Patches: #446

Discussion

  • Vasco Alexandre da Silva Costa

    Some comments. Instead of:
    + magsq_ov = ov.xov.x + ov.yov.y + ov.z*ov.z;

    this is more compact:
    + magsq_ov = dot(ov, ov);
    There are two occurrences of this pattern.

    Instead of declaring 'temp_hits[0..1]' you can reuse the 'hits[0..1]'
    variable. This should decrease the amount of stack space required.

    Instead of:
    + if (skip_to_hemispheres == false) {

    You can use:
    + if (!skip_to_hemispheres) {

    You need to re-check the 'if (check_v)' and 'if (check_h)' branches because
    the code is not 100% equivalent to that in part_shot().

    In the normal computation code 'part_norm' don't change 'hitp->hit_vpriv.z'
    like the current C code does. Copy the vector to a temporary variable and
    modify that. Otherwise code which calls the normal computation function
    more than once will get incorrect values. We may change this later when the
    curvature code gets implemented.

    Everything else looks great.

    On Mon, Jun 6, 2016 at 7:42 AM, Param Hanji catchchaos@users.sf.net wrote:


    Status: open-works-for-me
    Group: Incomplete
    Created: Mon Jun 06, 2016 06:42 AM UTC by Param Hanji
    Last Updated: Mon Jun 06, 2016 06:42 AM UTC
    Owner: Vasco Alexandre da Silva Costa
    Attachments:

    OpenCL code for PART. As usual, the GPU generated png as well as the diff
    file are attached.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/brlcad/patches/446/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

    --
    Vasco Alexandre da Silva Costa
    PhD in Computer Engineering (Computer Graphics)
    Instituto Superior Técnico/University of Lisbon, Portugal

     

    Related

    Patches: #446

    • Param Hanji

      Param Hanji - 2016-06-06

      I made a couple of minor changes to the patch as suggested. Regarding the 'check_v' and 'check_h', I needed to restructure the code slighly as the ANSI C version contains goto statements. I haven't changed the logic too much, and the required operations are still performed.

      Let me know if you see a flaw in the logic or feel that the current implementation may fail.

       
      • Vasco Alexandre da Silva Costa

        Check all the code paths on a piece of paper. The execution traces on those
        branches are not 100% the same.

        On Mon, Jun 6, 2016 at 6:40 PM, Param Hanji catchchaos@users.sf.net wrote:

        I made a couple of minor changes to the patch as suggested. Regarding the
        'check_v' and 'check_h', I needed to restructure the code slighly as the
        ANSI C version contains goto statements. I haven't changed the logic too
        much, and the required operations are still performed.

        Let me know if you see a flaw in the logic or feel that the current
        implementation may fail.


        Status: open-works-for-me
        Group: Incomplete
        Created: Mon Jun 06, 2016 06:42 AM UTC by Param Hanji
        Last Updated: Mon Jun 06, 2016 06:42 AM UTC
        Owner: Vasco Alexandre da Silva Costa
        Attachments:

        OpenCL code for PART. As usual, the GPU generated png as well as the diff
        file are attached.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/brlcad/patches/446/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

        --
        Vasco Alexandre da Silva Costa
        PhD in Computer Engineering (Computer Graphics)
        Instituto Superior Técnico/University of Lisbon, Portugal

         

        Related

        Patches: #446

    • Param Hanji

      Param Hanji - 2016-06-11

      Made some more changes. Tell me if this is fine.

       
  • Vasco Alexandre da Silva Costa

    I refactored the patch a bit so the control flow looks more similar to the ANSI C code. I also removed some code which modified the hit_vpriv field.

     
  • Vasco Alexandre da Silva Costa

    • status: open-works-for-me --> closed-accepted
     

Log in to post a comment.