kokkos / kokkos-kernels

Kokkos C++ Performance Portability Programming Ecosystem: Math Kernels - Provides BLAS, Sparse BLAS and Graph Kernels
Other
303 stars 96 forks source link

Bug fixes: Windows build issues #732

Open trmcnealy opened 4 years ago

trmcnealy commented 4 years ago

in KokkosKernels_IOUtils.hpp:

line 422 in kk_get_file_size function:

move the struct inside the preprocessor conditional and use struct _stat for Windows.

inline size_t kk_get_file_size(const char* file)
{
#ifdef _WINDOWS
  struct _stat stat_buf;
  int retval = _stat(file, &stat_buf);
#else
  struct stat stat_buf;
  int retval = stat(file, &stat_buf);
#endif

  return retval == 0 ? size_t(stat_buf.st_size) : size_t(0);
}

in KokkosSparse_spmv_tpl_spec_decl.hpp:

https://docs.nvidia.com/cuda/cusparse/index.html

  1. cuSPARSE Generic API Reference LIMITATION: The generic APIs are currently available for all platforms except Windows.

add && !defined(_WINDOWS)

line 74: #if defined(CUSPARSE_VERSION) && (10300 <= CUSPARSE_VERSION) && !defined(_WINDOWS)

Thanks!

lucbv commented 4 years ago

@trmcnealy thanks for reporting these! I can make these modifications once I know our policies regarding Windows builds, I don't usually do them : ) @srajama1 what's our current status on Windows build support, do we support particular compilers/platforms? @ndellingwood do we have a test machine easily accessible to check that bug fixes are going well?

ndellingwood commented 4 years ago

@lucbv

do we have a test machine easily accessible to check that bug fixes are going well

I don't know how easily accessible a machine is, I think @crtrott has a machine for Kokkos testing but I don't know if that is openly available.

Kokkos is also using appveyor for Windows testing of PRs, that is something we can also look into as PR autotesting progresses.

trmcnealy commented 4 years ago

FYI...

Windows 10 v2004 Intel Core i7 5960X[Haswell] Cuda 10.2 Clang 10.0.0/Msys2

CPPFLAGS=-U_MSC_VER -DHAVE_WINNT_IGNORE_VOID -DNDEBUG -D_NDEBUG -DWIN64 -D_WIN64 -D_WINDOWS -D_GNU_SOURCE -D_USE_MATH_DEFINES -D_MBCS -fomit-frame-pointer -fms-extensions -Xcuda-ptxas -w -w -O3 -std=c++17 -fcaret-diagnostics -fdiagnostics-show-template-tree -fcolor-diagnostics -fdiagnostics-parseable-fixits -fdiagnostics-format=msvc --target=x86_64-w64-windows-gnu-coff -fno-signed-char -fpermissive -ftls-model=global-dynamic -fcxx-exceptions -march=core-avx2 -mtune=core-avx2 -fno-trapping-math -fno-signed-zeros -ftemplate-backtrace-limit=0 -ferror-limit=10 -fvectorize -fslp-vectorize --cuda-path=C:/msys2/usr/local/cuda-10.2 --cuda-gpu-arch=sm_52 -x cuda -Wa,-mbig-obj -fopenmp=libomp -Xclang -flto-visibility-public-std

lucbv commented 4 years ago

@trmcnealy We will move ahead and make the changes to the code to fix the issues you pointed out. It will take a bit of time to go through our testing process but when we have a PR for it I will post it here in case you want to follow that process.