xnd-project / libgumath

Subsumed into xnd
https://xnd.io/
BSD 3-Clause "New" or "Revised" License
25 stars 14 forks source link

Gumath tests fail `ndt_copy_contiguous_dtype` due to new `linear_index` #32

Closed costrouc closed 5 years ago

costrouc commented 5 years ago

Tests fail with the following output due to recent changes. This is most likely a simple error from the recent linear_index added to ndtypes and I would like to dive into it tomorrow. Any help understanding the linear index would be appreciated!

test_unify (__main__.TestUnify) ... ok
test_apply (__main__.TestApply) ... ok
test_apply_error (__main__.TestApply) ... ok
gcc -I. -I.. -I../ndtypes/libndtypes -Wall -Wextra -std=c11 -pedantic -O3 -c kernels/common.c
kernels/common.c: In function 'unary_typecheck':
kernels/common.c:192:33: warning: implicit declaration of function 'ndt_dim_at'; did you mean 'ndt_init'? [-Wimplicit-function-declaration]
         if (ndt_is_c_contiguous(ndt_dim_at(t, t->ndim-1))) {
                                 ^~~~~~~~~~
                                 ndt_init
kernels/common.c:192:33: warning: passing argument 1 of 'ndt_is_c_contiguous' makes pointer from integer without a cast [-Wint-conversion]
In file included from kernels/common.c:40:0:
/nix/store/i9ggxgz86w5hwjqcyny33z96srcdva6n-libndtypes/include/ndtypes.h:657:17: note: expected 'const ndt_t * {aka const struct _ndt *}' but argument is of type 'int'
 NDTYPES_API int ndt_is_c_contiguous(const ndt_t *t);
                 ^~~~~~~~~~~~~~~~~~~
kernels/common.c:211:49: warning: passing argument 3 of 'ndt_copy_contiguous_dtype' makes integer from pointer without a cast [-Wint-conversion]
     dtype = ndt_copy_contiguous_dtype(t, dtype, ctx);
                                                 ^~~
In file included from kernels/common.c:40:0:
/nix/store/i9ggxgz86w5hwjqcyny33z96srcdva6n-libndtypes/include/ndtypes.h:678:26: note: expected 'int64_t {aka long int}' but argument is of type 'ndt_context_t * {aka struct _ndt_context *}'
 NDTYPES_API const ndt_t *ndt_copy_contiguous_dtype(const ndt_t *t, const ndt_t *dtype, int64_t linear_index, ndt_context_t *ctx);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
kernels/common.c:211:13: error: too few arguments to function 'ndt_copy_contiguous_dtype'
     dtype = ndt_copy_contiguous_dtype(t, dtype, ctx);
             ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kernels/common.c:40:0:
/nix/store/i9ggxgz86w5hwjqcyny33z96srcdva6n-libndtypes/include/ndtypes.h:678:26: note: declared here
 NDTYPES_API const ndt_t *ndt_copy_contiguous_dtype(const ndt_t *t, const ndt_t *dtype, int64_t linear_index, ndt_context_t *ctx);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:114: common.o] Error 1
make[1]: Leaving directory '/build/source/libgumath'
make: *** [Makefile:25: default] Error 2
skrah commented 5 years ago

Thanks, yes, I was aware of it. It is part of bigger changes (VarDimElem ) that were more convenient to commit in parts. gumath will sometimes be broken for a short duration, but it's fixed now.