I have a subroutine that allocates a workspace for MKL routines, and I want to specify the alignment of the allocated buffer. I'm using the ATTRIBUTES ALIGN directive. This works for e.g. allocatable automatic variables, but doesn't want to work for allocatable dummy arguments. For example, this fails:
subroutine create_workspace ( this, work ) class(object), intent(in) :: this real(kind=DP), allocatable, intent(inout) :: work(:) !DIR$ ATTRIBUTES ALIGN:64 :: work allocate(work(10)) end subroutine create_workspace
The error is
error #6406: Conflicting attributes or multiple declaration of name. [WORK]
Am I doing something totally wrong here? Is there better way to accomplish this? I'm looking for something that works on both Windows and Linux. The compiler version is 64-bit, 126.96.36.199.