[code-reflection] RFR: Regularize support for Java types/references [v5]
Paul Sandoz
psandoz at openjdk.org
Fri May 23 15:25:01 UTC 2025
On Fri, 23 May 2025 10:24:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix examples
>
> cr-examples/triton/src/test/java/oracle/code/triton/TestAddKernel.java line 109:
>
>> 107: @TritonCodeModel("""
>> 108: module ()java.type:"void" -> {
>> 109: tt.func @"add_kernel2_ptr<java.type.primitive<float>>_ptr<java.type.primitive<float>>_ptr<java.type.primitive<float>>_int_64_void" (%0 : ptr<java.type:"float">, %1 : ptr<java.type:"float">, %2 : ptr<java.type:"float">, %3 : java.type:"int")java.type:"void" -> {
>
> Note (in this and other tests) -- the signature of the triton function contains the literal externalized type string of the various parameter/return types. These are NOT flattened strings because e.g. `Ptr::toString` does not flatten (nor it knows how to, if we were to use the public API). This leads to some asymmetry, where in some cases the inflated form appears in full (as here), while in other cases the short type string appears (e.g. because the type is a Java type, and its `toString` is more friendly).
>
> I had half a mind to make `toString` of all triton types more friendly (e.g. not rely on externalize) -- but ultimately I decided to just stick with this very basic conversion -- perhaps we can come back to this later?
This is fine IMO. If need be we can revisit later on.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/432#discussion_r2104823252
More information about the babylon-dev
mailing list