OpenCL-TTL icon indicating copy to clipboard operation
OpenCL-TTL copied to clipboard

Mixed definitions cause problems for some tool sets.

Open chrisgearing opened this issue 1 year ago • 0 comments

TTL contains code code that looks like the follow

//

static inline TTL_int_void_sub_tensor_t __attribute__((overloadable))
TTL_step_buffering(TTL_import_double_const_void_tensor_buffering_t *const db, const TTL_tile_t next_tile);

...snip

   result.prev_tile = TTL_create_empty_tile();

    TTL_step_buffering(&result, first_tile);

    return result;
}

...snip

static inline TTL_int_void_sub_tensor_t __attribute__((overloadable))
TTL_step_buffering(TTL_import_double_const_void_tensor_buffering_t *db, const TTL_tile_t next_tile) {
    const TTL_layout_t int_layout = TTL_create_layout(next_tile.shape.width, next_tile.shape.height);
    const TTL_int_void_sub_tensor_t import_to = TTL_create_int_sub_tensor(
...

Note the const is not present in the declaration but is in the pre-definition; technically, this is not incorrect and, in most cases, is compiled. However, some tools incorrectly generate different overload signatures, and so fail to link.

Could you update all the cases where this difference happens?

chrisgearing avatar Feb 27 '24 17:02 chrisgearing