Skip to content

Commit

Permalink
Add targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
DJDavies2 committed Jun 15, 2024
1 parent 730d4ba commit 0bdf739
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/fckit/module/fckit_tensor.F90
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function ctor_float_from_shape(shape, layout) result(this)

function ctor_from_float_array_rank1(tensor, layout) result(this)
type(fckit_tensor_real32) :: this
real(c_float), intent(in) :: tensor(:)
real(c_float), intent(in), target :: tensor(:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_float), pointer :: data_vec(:)
Expand All @@ -199,7 +199,7 @@ function ctor_from_float_array_rank1(tensor, layout) result(this)

function ctor_from_float_array_rank2(tensor, layout) result(this)
type(fckit_tensor_real32) :: this
real(c_float), intent(in) :: tensor(:,:)
real(c_float), intent(in), target :: tensor(:,:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_float), pointer :: data_vec(:)
Expand All @@ -218,7 +218,7 @@ function ctor_from_float_array_rank2(tensor, layout) result(this)

function ctor_from_float_array_rank3(tensor, layout) result(this)
type(fckit_tensor_real32) :: this
real(c_float), intent(in) :: tensor(:,:,:)
real(c_float), intent(in), target :: tensor(:,:,:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_float), pointer :: data_vec(:)
Expand All @@ -238,7 +238,7 @@ function ctor_from_float_array_rank3(tensor, layout) result(this)

function ctor_from_float_array_rank4(tensor, layout) result(this)
type(fckit_tensor_real32) :: this
real(c_float), intent(in) :: tensor(:,:,:,:)
real(c_float), intent(in), target :: tensor(:,:,:,:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_float), pointer :: data_vec(:)
Expand Down Expand Up @@ -376,7 +376,7 @@ function ctor_double_from_shape(shape, layout) result(this)

function ctor_from_double_array_rank1(tensor, layout) result(this)
type(fckit_tensor_real64) :: this
real(c_double), intent(in) :: tensor(:)
real(c_double), intent(in), target :: tensor(:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_double), pointer :: data_vec(:)
Expand All @@ -396,7 +396,7 @@ function ctor_from_double_array_rank1(tensor, layout) result(this)

function ctor_from_double_array_rank2(tensor, layout) result(this)
type(fckit_tensor_real64) :: this
real(c_double), intent(in) :: tensor(:,:)
real(c_double), intent(in), target :: tensor(:,:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_double), pointer :: data_vec(:)
Expand All @@ -415,7 +415,7 @@ function ctor_from_double_array_rank2(tensor, layout) result(this)

function ctor_from_double_array_rank3(tensor, layout) result(this)
type(fckit_tensor_real64) :: this
real(c_double), intent(in) :: tensor(:,:,:)
real(c_double), intent(in), target :: tensor(:,:,:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_double), pointer :: data_vec(:)
Expand All @@ -435,7 +435,7 @@ function ctor_from_double_array_rank3(tensor, layout) result(this)

function ctor_from_double_array_rank4(tensor, layout) result(this)
type(fckit_tensor_real64) :: this
real(c_double), intent(in) :: tensor(:,:,:,:)
real(c_double), intent(in), target :: tensor(:,:,:,:)
integer(c_int), intent(in), optional :: layout
integer(c_int) :: layout_actual = 1 ! left-layout (col-major)
real(c_double), pointer :: data_vec(:)
Expand Down
10 changes: 5 additions & 5 deletions src/tests/test_tensor.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ subroutine check_tensor_float(cptr, esize, erank, layout)
subroutine check_tensor_float_layout_r3(cptr, data)
use iso_c_binding, only : c_ptr, c_float, c_size_t, c_int
type(c_ptr), value :: cptr
real(c_float), intent(in) :: data(:,:,:)
real(c_float), intent(in), target :: data(:,:,:)
real(c_float), pointer :: data_vec(:)
integer(c_size_t) :: shape_vec(3)
integer(c_size_t) :: data_rank
Expand All @@ -121,7 +121,7 @@ subroutine check_tensor_float_layout_r3(cptr, data)
subroutine check_tensor_float_layout_r4(cptr, data)
use iso_c_binding, only : c_ptr, c_float, c_size_t, c_int
type(c_ptr), value :: cptr
real(c_float), intent(in) :: data(:,:,:,:)
real(c_float), intent(in), target :: data(:,:,:,:)
real(c_float), pointer :: data_vec(:)
integer(c_size_t) :: shape_vec(4)
integer(c_size_t) :: data_rank
Expand Down Expand Up @@ -162,7 +162,7 @@ subroutine check_tensor_double(cptr, esize, erank, layout)
subroutine check_tensor_double_layout_r3(cptr, data)
use iso_c_binding, only : c_ptr, c_double, c_size_t, c_int
type(c_ptr), value :: cptr
real(c_double), intent(in) :: data(:,:,:)
real(c_double), intent(in), target :: data(:,:,:)
real(c_double), pointer :: data_vec(:)
integer(c_size_t) :: shape_vec(3)
integer(c_size_t) :: data_rank
Expand All @@ -177,7 +177,7 @@ subroutine check_tensor_double_layout_r3(cptr, data)
subroutine check_tensor_double_layout_r4(cptr, data)
use iso_c_binding, only : c_ptr, c_double, c_size_t, c_int
type(c_ptr), value :: cptr
real(c_double), intent(in) :: data(:,:,:,:)
real(c_double), intent(in), target :: data(:,:,:,:)
real(c_double), pointer :: data_vec(:)
integer(c_size_t) :: shape_vec(4)
integer(c_size_t) :: data_rank
Expand Down Expand Up @@ -631,4 +631,4 @@ end module fcta_tensor_f_fxt
END_TEST


END_TESTSUITE
END_TESTSUITE

0 comments on commit 0bdf739

Please sign in to comment.