[code-reflection] Integrated: Added OpWrapper for CoreOp.NegOp (needed for blackscholes)

Gary Frost gfrost at openjdk.org
Wed Oct 16 11:19:08 UTC 2024


On Wed, 16 Oct 2024 11:11:36 GMT, Gary Frost <gfrost at openjdk.org> wrote:

> Blackscholes example failed when generating CUDA/OpenCL via C99HatBuilder
> 
> We were missing OpWrapper for CoreOp.NegOp (unary - ) 
> 
> This PR fixes that and adds balckscholes to new `bld` script
> 
> There is still a code-gen issue stemming from 
> 
>  @CodeReflection
>     public static float CND(float input) {
>         // yada 
>         if (input >= 0f) {
>             return 1f - part1 * part2;
>         }else{
>            return part1 * part2;
>         }
>     } 
> 
> Which incorrectly generates OpenCL
> 
>     if(input>=0.0){
>         return 1.0-part1*part2;
>     }else{
>         return part1*part2;
>     }
>     return;  //<----------------   ???

This pull request has now been integrated.

Changeset: f4a8b2d9
Author:    Gary Frost <gfrost at openjdk.org>
URL:       https://git.openjdk.org/babylon/commit/f4a8b2d9e00ea5fe0e598727b142bfd9888430fd
Stats:     457 lines in 9 files changed: 257 ins; 75 del; 125 mod

Added OpWrapper for CoreOp.NegOp (needed for blackscholes)

-------------

PR: https://git.openjdk.org/babylon/pull/255


More information about the babylon-dev mailing list