% -*- fundamental -*-

:- use_module(fftw_codelets).
:- use_module(fftwgel_auxcode).
:- use_module(fftwgel_simdvectorization_core).
:- use_module(fftwgel_simdvectorization_verification).

codeletname_vectorized(Name, Vectorized) :-
   codeletname_scalarinstrs(Name, ScalarCode),
   ensure_(is_scalarinstrs(ScalarCode), invalid_scalarcode),
   scalarinstrs_bindings_simdinstrs(ScalarCode, _Bindings, Vectorized),
   ensure_(is_simdinstrs(Vectorized), invalid_simdcode),
   ensure_((phrase(scalarinstrsForSIMDInstrs(Vectorized), ScalarCodePermuted),
	    list_permutation(ScalarCodePermuted, ScalarCode)),
	   vectorization_refuted).
