Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Diagnostic 15513: Incorrect type of mask parameter of vector variant 'xxxx' of function 'xxxx' at position <val>

$
0
0

Cause:

This diagnostic is emitted by Intel(R) C++ Compiler 15.0 and above. This example uses User implemented vector variant of the function. Traditionally the vector variant of the user defined​ function is created by the compiler using __attribute__((vector)) with relevant clauses. Here the developer can provide target certain processors by providing the intrinsics implementation which targets those processor architecture. In this example, we create a vector variant of the scalar function MyMax() and target the vector variant for core i7 processor SSE4.2 architecture. This error pops up because the vector variant of the MyMax() function has the wrong vector variant data type. The data type for mask parameter used in vector variant of MyMax() is __m128i and the right data type is __m128.

Examples:


#include <immintrin.h>

	#include <stdio.h>

	#include <stdlib.h>

	#include <string.h>

#define NN 1021

//__declspec(vector)

	__declspec(noinline)

	float MyMax(float* a, float b)

	{

	  return *a + b;

	}

__declspec(vector_variant(implements(MyMax(float* a, float b)),

	                          vectorlength(4), processor(core_i7_sse4_2), mask))

	__m128 MyMaxVec(__m128i v_a1, __m128i v_a2,  __m128 v_b, __m128i msk)

	{

	  return _mm_add_ps(_mm_cvtepi32_ps(v_a1), v_b);

	}

$ icpc test57.cc -c -qopt-report2 -qopt-report-phase=vec -qopt-report-file=stderr
error #15513: Incorrect type of mask parameter of vector variant '_Z8MyMaxVec7__m128iS_6__m128S_' of function '_Z5MyMaxPff' at position 3.

 The correct prototype is: '__m128 _Z8MyMaxVec7__m128iS_6__m128S_(__m128i v0_0, __m128i v0_1, __m128 v1_0, __m128 m0_0)'.
compilation aborted for test57.cc (code 1)

Resolution:

Change the mask parameter data type from __m128i to __m128.


#include <immintrin.h>

	#include <stdio.h>

	#include <stdlib.h>

	#include <string.h>

#define NN 1021

//__declspec(vector)

	__declspec(noinline)

	float MyMax(float* a, float b)

	{

	  return *a + b;

	}

__declspec(vector_variant(implements(MyMax(float* a, float b)),

	                          vectorlength(4), processor(core_i7_sse4_2), mask))

	__m128 MyMaxVec(__m128i v_a1, __m128i v_a2,  __m128 v_b, __m128 msk)

	{

	  return _mm_add_ps(_mm_cvtepi32_ps(v_a1), v_b);

	}


Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>