Skip to content

Commit

Permalink
Merge branch 'pytorch_release' into xu_add_optional_static_build_config
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhancn committed Mar 8, 2024
2 parents 1ecc57e + e3205b3 commit 3050f5e
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 34 deletions.
39 changes: 19 additions & 20 deletions src/libm/CMakeLists.txt
Expand Up @@ -981,29 +981,28 @@ endif()
# TARGET_LIBSLEEFSCALAR
# --------------------------------------------------------------------
# Build scalar-only library from sleefdp.c and sleefsp.c
if(SLEEF_BUILD_SCALAR_LIB)
if(SLEEF_BUILD_SHARED_LIBS)
add_library(sleefscalar SHARED sleefdp.c sleefsp.c rempitab.c)
else()
add_library(sleefscalar STATIC sleefdp.c sleefsp.c rempitab.c)
endif()
add_dependencies(sleefscalar ${TARGET_HEADERS})
set_target_properties(sleefscalar PROPERTIES
VERSION ${SLEEF_VERSION}
SOVERSION ${SLEEF_SOVERSION}
PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER}
${COMMON_TARGET_PROPERTIES}
)

if(SLEEF_BUILD_SHARED_LIBS)
add_library(sleefscalar SHARED sleefdp.c sleefsp.c rempitab.c)
else()
add_library(sleefscalar STATIC sleefdp.c sleefsp.c rempitab.c)
endif()
add_dependencies(sleefscalar ${TARGET_HEADERS})
set_target_properties(sleefscalar PROPERTIES
VERSION ${SLEEF_VERSION}
SOVERSION ${SLEEF_SOVERSION}
PUBLIC_HEADER ${SLEEF_INCLUDE_HEADER}
${COMMON_TARGET_PROPERTIES}
)

target_compile_definitions(sleefscalar
PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS}
)
target_compile_definitions(sleefscalar
PRIVATE DORENAME=1 ${COMMON_TARGET_DEFINITIONS}
)

if(COMPILER_SUPPORTS_BUILTIN_MATH)
target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1)
endif()
if(COMPILER_SUPPORTS_BUILTIN_MATH)
target_compile_definitions(sleefscalar PRIVATE ENABLE_BUILTIN_MATH=1)
endif()

if(SLEEF_BUILD_SCALAR_LIB)
install(
TARGETS sleefscalar
EXPORT sleefTargets
Expand Down
4 changes: 2 additions & 2 deletions src/libm/sleefdp.c
Expand Up @@ -28,9 +28,9 @@ extern const double Sleef_rempitabdp[];

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

#define MLA mla
#define C2V(x) (x)
Expand Down
4 changes: 2 additions & 2 deletions src/libm/sleefinline_header.h.org
Expand Up @@ -18,9 +18,9 @@

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

#ifndef SLEEF_FP_ILOGB0
#define SLEEF_FP_ILOGB0 ((int)0x80000000)
Expand Down
4 changes: 2 additions & 2 deletions src/libm/sleefsimddp.c
Expand Up @@ -23,9 +23,9 @@ extern const double Sleef_rempitabdp[];

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

// Intel

Expand Down
4 changes: 2 additions & 2 deletions src/libm/sleefsimdsp.c
Expand Up @@ -23,9 +23,9 @@ extern const float Sleef_rempitabsp[];

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

// Intel

Expand Down
4 changes: 2 additions & 2 deletions src/libm/sleefsp.c
Expand Up @@ -28,9 +28,9 @@ extern const float Sleef_rempitabsp[];

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

#define MLA mlaf
#define C2V(x) (x)
Expand Down
2 changes: 2 additions & 0 deletions src/quad/sleefquadinline_cuda_header.h.org
Expand Up @@ -17,6 +17,8 @@

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#else
#pragma STDC FP_CONTRACT OFF
#endif

__device__ const double Sleef_rempitabqp[] = {
Expand Down
4 changes: 2 additions & 2 deletions src/quad/sleefquadinline_header.h.org
Expand Up @@ -18,9 +18,9 @@

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

#ifndef SLEEF_FP_ILOGB0
#define SLEEF_FP_ILOGB0 ((int)0x80000000)
Expand Down
4 changes: 2 additions & 2 deletions src/quad/sleefsimdqp.c
Expand Up @@ -23,9 +23,9 @@ extern const double Sleef_rempitabqp[];

#if defined(_MSC_VER) && !defined (__clang__)
#pragma fp_contract (off)
#endif

#else
#pragma STDC FP_CONTRACT OFF
#endif

#ifdef ENABLE_PUREC_SCALAR
#define CONFIG 1
Expand Down

0 comments on commit 3050f5e

Please sign in to comment.