Skip to content

Commit 6040e3a

Browse files
committed
defs hack
1 parent cac7849 commit 6040e3a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

backends/cuda/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ set(_aoti_cuda_sources
4646
)
4747
# Build as SHARED library (.dll) on Windows MSVC, otherwise STATIC
4848
if(MSVC)
49-
add_library(aoti_cuda SHARED ${_aoti_cuda_sources})
49+
add_library(aoti_cuda SHARED ${_aoti_cuda_sources} ${CMAKE_CURRENT_SOURCE_DIR}/aoti_cuda.def)
5050
# Define export macros for Windows DLL
5151
target_compile_definitions(aoti_cuda PRIVATE
5252
EXPORT_AOTI_FUNCTIONS
5353
BUILDING_CUDA_BACKEND
5454
)
5555
# Ensure proper DLL import/export library naming on Windows with config-specific paths
5656
set_target_properties(aoti_cuda PROPERTIES
57-
WINDOWS_EXPORT_ALL_SYMBOLS OFF # We use explicit exports via AOTI_CUDA_EXPORT
57+
WINDOWS_EXPORT_ALL_SYMBOLS OFF # We use explicit exports via AOTI_CUDA_EXPORT and .def file
5858
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>
5959
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>
6060
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>

backends/cuda/aoti_cuda.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LIBRARY aoti_cuda
2+
EXPORTS
3+
InitCudaBackend

backends/cuda/runtime/cuda_backend.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <executorch/runtime/core/evalue.h>
1313
#include <executorch/runtime/core/exec_aten/util/tensor_util.h>
1414
#include <cstdio>
15+
#include <cassert>
1516

1617
#include <filesystem>
1718
#include <fstream>
@@ -388,6 +389,7 @@ static executorch::runtime::Error success_with_compiler =
388389
extern "C" CUDA_BACKEND_INIT_API void InitCudaBackend() {
389390
// Log immediately to confirm function is entered
390391
ET_LOG(Info, "InitCudaBackend: Function entered");
392+
assert(1==2)
391393

392394
#ifdef _WIN32
393395
ET_LOG(Info, "InitCudaBackend: Windows path");

0 commit comments

Comments
 (0)