Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conda-recipe/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
75 changes: 75 additions & 0 deletions dpnp/backend/extensions/fft/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,32 @@

#pragma once

#include <iostream>
#include <stdexcept>
#include <type_traits>
#include <typeinfo>

// cxxabi.h is only available on GCC/Clang, not on MSVC
#ifdef __GNUC__
#include <cxxabi.h>
#endif

#include <oneapi/mkl.hpp>
#include <pybind11/pybind11.h>
#include <sycl/sycl.hpp>

// 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;
Expand Down Expand Up @@ -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<typename valT::value_type,
std::int64_t> << 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
}
Expand Down Expand Up @@ -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<typename valT::value_type, std::int64_t>::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
}
Expand Down
Loading