SystemVerilog standard does not allow a DPI import task to be marked as pure.
pure
Even if some tools allow this syntax, refrain from using it to keep your code portable.
import "DPI-C" pure task func(logic [3:0] a);