view test/LazyTensors/lazy_tensor_test.jl @ 1064:a601427023e3 feature/nested_stencils

Add type stability tests for nested stencil application (grafted from 47f5451cdfc4ad3d070c6f017c88644746e17669)
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 15 Feb 2022 07:54:52 +0100
parents aa72f067e771
children 471a948cd2b2
line wrap: on
line source

using Test
using Sbplib.LazyTensors

@testset "Generic Mapping methods" begin
    struct DummyMapping{T,R,D} <: LazyTensor{T,R,D} end
    LazyTensors.apply(m::DummyMapping{T,R,D}, v, I::Vararg{Any,R}) where {T,R,D} = :apply
    @test range_dim(DummyMapping{Int,2,3}()) == 2
    @test domain_dim(DummyMapping{Int,2,3}()) == 3
    @test apply(DummyMapping{Int,2,3}(), zeros(Int, (0,0,0)),0,0) == :apply
    @test eltype(DummyMapping{Int,2,3}()) == Int
    @test eltype(DummyMapping{Float64,2,3}()) == Float64
end