Skip to content

Warning with inv() and Float32 #241

Closed
@NoelAraujo

Description

@NoelAraujo

I got a warning message using Float32.

julia> using ArrayFire, Random
ArrayFire v3.6.4 (OpenCL, 64-bit Linux, build 1b8030c)
[0] AMD: gfx900, 8176 MB

julia> Random.seed!(1111);

With Float64 everything is OK.

julia> a = AFArray(rand(4,4))
AFArray: 4×4 Array{Float64,2}:
 0.470171  0.584869  0.566602  0.0413684
 0.19116   0.711075  0.582562  0.321194 
 0.235326  0.282443  0.580429  0.26694  
 0.949497  0.652569  0.430244  0.169926

julia> b = inv(a)
AFArray: 4×4 Array{Float64,2}:
 -0.439821  -1.09483   0.517833   1.36306  
  0.495136   2.01835  -2.48217   -0.0363446
  1.93608   -1.29507   2.02148   -1.19898  
 -4.34593    1.64557   1.52052    1.44387

Now with Float32

julia> c = AFArray(rand(Float32, 4,4))
AFArray: 4×4 Array{Float32,2}:
 0.68572   0.0311699  0.328728  0.89972   
 0.454269  0.771371   0.401835  0.00835252
 0.424401  0.27596    0.51567   0.916684  
 0.390926  0.978439   0.141881  0.907653

julia> d = inv(c)
/tmp/AMD_11110_154/t_11110_156.cl:1:26: warning: unknown OpenCL extension 'cl_amd_printf' - ignoring [-Wignored-pragmas]
#pragma OPENCL EXTENSION cl_amd_printf : enable
                         ^
/tmp/AMD_11110_154/t_11110_156.cl:82:18: warning: assigning to '__global float *' from 'const __global float *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            uA.f = A + k0 * lda;
                 ^ ~~~~~~~~~~~~
/tmp/AMD_11110_154/t_11110_156.cl:178:14: warning: assigning to '__global float *' from 'const __global float *restrict' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        uA.f = A;
             ^ ~
/tmp/AMD_11110_154/t_11110_156.cl:203:42: warning: incompatible pointer types initializing '__global float4 *' with an expression of type '__global float *' [-Wincompatible-pointer-types]
                        __global float4 *pC = uC.f;
                                         ^    ~~~~
/tmp/AMD_11110_154/t_11110_156.cl:460:34: warning: incompatible pointer types initializing '__global float4 *' with an expression of type '__global float *' [-Wincompatible-pointer-types]
                __global float4 *pC = uC.f;
                                 ^    ~~~~
5 warnings generated.
/tmp/AMD_11110_171/t_11110_173.cl:1:26: warning: unknown OpenCL extension 'cl_amd_printf' - ignoring [-Wignored-pragmas]
#pragma OPENCL EXTENSION cl_amd_printf : enable
                         ^
/tmp/AMD_11110_171/t_11110_173.cl:83:18: warning: assigning to '__global float *' from 'const __global float *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            uA.f = A + k0 * lda;
                 ^ ~~~~~~~~~~~~
/tmp/AMD_11110_171/t_11110_173.cl:179:14: warning: assigning to '__global float *' from 'const __global float *restrict' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        uA.f = A;
             ^ ~
/tmp/AMD_11110_171/t_11110_173.cl:237:42: warning: incompatible pointer types initializing '__global float4 *' with an expression of type '__global float *' [-Wincompatible-pointer-types]
                        __global float4 *pC = uC.f;
                                         ^    ~~~~
/tmp/AMD_11110_171/t_11110_173.cl:476:34: warning: incompatible pointer types initializing '__global float4 *' with an expression of type '__global float *' [-Wincompatible-pointer-types]
                __global float4 *pC = uC.f;
                                 ^    ~~~~
5 warnings generated.
AFArray: 4×4 Array{Float32,2}:
  2.2628      0.857163  -2.0649    -0.165458
 -0.620097    0.41937   -0.137865   0.750055
 -1.36579     0.733995   2.58582   -1.26445 
 -0.0926348  -0.935992   0.633766   0.562109


julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)

Any clues ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions