Skip to content

masOS rsqrt failure #413

@kennykos

Description

@kennykos

The simple program

import pykokkos as pk

@pk.workunit
def workunit(i):
    j: float = rsqrt(i)

pk.parallel_for(10, workunit)

fails with

In file included from <path-to>/pk_cpp/tmp/tmp_workunit/types_fa7153f7ed1cb6c0fcf2ffb2fac21748/OpenMP/bindings.cpp:10:
<path-to>/pk_cpp/tmp/tmp_workunit/types_fa7153f7ed1cb6c0fcf2ffb2fac21748/OpenMP/../functor.hpp:5:301: error: use of undeclared identifier 'rsqrt'; did you mean 'sqrt'?
    5 | template <class ExecSpace>struct pk_functor_workunit{struct workunit_tag{}; pk_functor_workunit(int32_t pk_field, int32_t pk_randpool_num_states, int32_t pk_randpool_seed){  }; pk_functor_workunit(int32_t pk_field){  };KOKKOS_FUNCTION void operator()(const workunit_tag& , int32_t i)const{ double j= rsqrt(i); };};
      |                                                                                                                                                                                                                                                                                                             ^~~~~
      |                                                                                                                                                                                                                                                                                                             sqrt
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:457:15: note: 'sqrt' declared here
  457 | extern double sqrt(double);
      |               ^
1 error generated.
make[2]: *** [CMakeFiles/kernel.cpython-313-darwin.dir/bindings.cpp.o] Error 1
make[1]: *** [CMakeFiles/kernel.cpython-313-darwin.dir/all] Error 2
make: *** [all] Error 2

CMake build in pk_cpp/tmp/tmp_workunit/types_fa7153f7ed1cb6c0fcf2ffb2fac21748/OpenMP failed

on macOS.

Fixes:

  • fix rsqrt on macOS
  • update macOS CI to run all tests on macOS (currently, only on example is checked)

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