diff --git a/conda-recipe/run_test.bat b/conda-recipe/run_test.bat index f6f6a061c5f..d64401dc0af 100644 --- a/conda-recipe/run_test.bat +++ b/conda-recipe/run_test.bat @@ -37,5 +37,5 @@ if %errorlevel% neq 0 exit 1 "%PYTHON%" -m dpctl -f if %errorlevel% neq 0 exit 1 -"%PYTHON%" -m pytest -ra --pyargs dpnp +"%PYTHON%" -m pytest -s -ra --pyargs dpnp if %errorlevel% neq 0 exit 1 diff --git a/dpnp/backend/extensions/fft/common.hpp b/dpnp/backend/extensions/fft/common.hpp index 44f0b43f859..bdd87e4eb4f 100644 --- a/dpnp/backend/extensions/fft/common.hpp +++ b/dpnp/backend/extensions/fft/common.hpp @@ -28,12 +28,32 @@ #pragma once +#include #include +#include +#include + +// cxxabi.h is only available on GCC/Clang, not on MSVC +#ifdef __GNUC__ +#include +#endif #include #include #include +// Compile-time tracing: Show which API version is being used +#ifdef INTEL_MKL_VERSION +#pragma message("INTEL_MKL_VERSION is defined: " __DATE__) +#if INTEL_MKL_VERSION >= 20250000 +#pragma message("Using NEW MKL API (>= 2025.0): vector-based interface") +#else +#pragma message("Using OLD MKL API (< 2025.0): pointer-based interface") +#endif +#else +#pragma message("WARNING: INTEL_MKL_VERSION is not defined!") +#endif + namespace dpnp::extensions::fft { namespace mkl_dft = oneapi::mkl::dft; @@ -130,9 +150,36 @@ class DescriptorWrapper throw py::value_error( "Strides length does not match descriptor's dimension"); } + + // Runtime tracing: log type information + std::cerr << "[TRACE] set_fwd_strides:" << std::endl; + std::cerr << " - INTEL_MKL_VERSION: " << INTEL_MKL_VERSION + << std::endl; +#ifdef __GNUC__ + // Demangle type name on GCC/Clang + int status; + char *demangled = + abi::__cxa_demangle(typeid(valT).name(), nullptr, nullptr, &status); + std::cerr << " - valT type: " + << (status == 0 ? demangled : typeid(valT).name()) + << std::endl; + if (demangled) + free(demangled); +#else + // On MSVC, just print mangled name + std::cerr << " - valT type: " << typeid(valT).name() << std::endl; +#endif + std::cerr << " - valT::value_type == std::int64_t: " + << std::is_same_v << std::endl; + #if INTEL_MKL_VERSION >= 20250000 + std::cerr << " - API: NEW (passing vector object)" << std::endl; + std::cerr.flush(); // Force output to be visible in pytest descr_.set_value(mkl_dft::config_param::FWD_STRIDES, strides); #else + std::cerr << " - API: OLD (passing data pointer)" << std::endl; + std::cerr.flush(); // Force output to be visible in pytest descr_.set_value(mkl_dft::config_param::FWD_STRIDES, strides.data()); #endif // INTEL_MKL_VERSION } @@ -162,9 +209,37 @@ class DescriptorWrapper throw py::value_error( "Strides length does not match descriptor's dimension"); } + + // Runtime tracing: log type information + std::cerr << "[TRACE] set_bwd_strides:" << std::endl; + std::cerr << " - INTEL_MKL_VERSION: " << INTEL_MKL_VERSION + << std::endl; +#ifdef __GNUC__ + // Demangle type name on GCC/Clang + int status; + char *demangled = + abi::__cxa_demangle(typeid(valT).name(), nullptr, nullptr, &status); + std::cerr << " - valT type: " + << (status == 0 ? demangled : typeid(valT).name()) + << std::endl; + if (demangled) + free(demangled); +#else + // On MSVC, just print mangled name + std::cerr << " - valT type: " << typeid(valT).name() << std::endl; +#endif + std::cerr + << " - valT::value_type == std::int64_t: " + << std::is_same::value + << std::endl; + #if INTEL_MKL_VERSION >= 20250000 + std::cerr << " - API: NEW (passing vector object)" << std::endl; + std::cerr.flush(); // Force output to be visible in pytest descr_.set_value(mkl_dft::config_param::BWD_STRIDES, strides); #else + std::cerr << " - API: OLD (passing data pointer)" << std::endl; + std::cerr.flush(); // Force output to be visible in pytest descr_.set_value(mkl_dft::config_param::BWD_STRIDES, strides.data()); #endif // INTEL_MKL_VERSION }