Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Melt windows fix #137

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions examples/1_SimpleNet/simplenet_infer_fortran.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
program inference

! Import precision info from iso
use, intrinsic :: iso_fortran_env, only : sp => real32
use, intrinsic :: iso_fortran_env, only : sp => real32, int64

! Import our library for interfacing with PyTorch
use ftorch
Expand All @@ -17,7 +17,7 @@ program inference
! Set up Fortran data structures
real(wp), dimension(5), target :: in_data
real(wp), dimension(5), target :: out_data
integer :: tensor_layout(1) = [1]
integer(FT_INT) :: tensor_layout(1) = [1]

! Set up Torch data structures
! The net, a vector of input tensors (in this case we only have one), and the output tensor
Expand Down
4 changes: 2 additions & 2 deletions examples/2_ResNet18/resnet_infer_fortran.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ subroutine main()

integer, parameter :: in_dims = 4
integer :: in_shape(in_dims) = [1, 3, 224, 224]
integer :: in_layout(in_dims) = [1, 2, 3, 4]
integer(FT_INT) :: in_layout(in_dims) = [1, 2, 3, 4]
integer, parameter :: out_dims = 2
integer :: out_shape(out_dims) = [1, 1000]
integer :: out_layout(out_dims) = [1, 2]
integer(FT_INT) :: out_layout(out_dims) = [1, 2]

! Path to input data
character(len=100) :: data_dir
Expand Down
2 changes: 1 addition & 1 deletion examples/4_MultiIO/multiionet_infer_fortran.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ program inference
real(wp), dimension(4), target :: in_data2
real(wp), dimension(4), target :: out_data1
real(wp), dimension(4), target :: out_data2
integer :: tensor_layout(1) = [1]
integer(FT_INT) :: tensor_layout(1) = [1]

! Set up Torch data structures
! The net, a vector of input tensors (in this case we only have one), and the output tensor
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ set(PROJECT_NAME FTorch)
set(LIB_NAME ftorch)
set(PACKAGE_VERSION 0.1)

if (WIN32)
set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set (BUILD_SHARED_LIBS TRUE)
endif ()

project(${PROJECT_NAME} VERSION ${PACKAGE_VERSION} LANGUAGES C CXX Fortran)

include(FortranCInterface)
Expand Down
Loading
Loading