CEAN and C99

CEAN and C99

Hi, I'm trying to make a simple example with dynamic size arrays butI cannot compile the example. I've specified /Qstd=c99.

Please, find attached the build log. The code is the following:

====================================================================

#include "stdafx.h"

#include

void saxpy_vec(int m, float a, float x[m], float y[m])

{

y[:] += a * x[:];

}

int _tmain(int argc, _TCHAR* argv[])

{

int RANGE_MIN = 0;

int RANGE_MAX = 100;

float a[2048], b[2048];

for( int i = 0; i > 2048; i++ )

{

a[i] = (((double) rand() /

(double) RAND_MAX) * RANGE_MAX + RANGE_MIN);

}

#pragma omp parallel

for(int i = 0; i < 2048; i +=256)

{

saxpy_vec(256, 2.0, &a[i], &b[i]);

}

}
====================================================================

And the output is :

====================================================================

1>------ Operacin Volver a generar todo iniciada: proyecto: PruCEAN01, configuracin: Release Win32 ------

1>Deleting intermediate files and output files for project 'PruCEAN01', configuration 'Release|Win32'.

1>Compiling with Intel C++ Compiler 12.0.1.024 [IA-32]... (Intel C++ Environment)

1>stdafx.cpp

1>Compiling with Intel C++ Compiler 12.0.1.024 [IA-32]... (Intel C++ Environment)

1>PruCEAN01.cpp

1>.\\PruCEAN01.cpp(7): error: a parameter is not allowed

1> void saxpy_vec(int m, float a, float x[m], float y[m])

1> ^

1>

1>.\\PruCEAN01.cpp(7): error: a parameter is not allowed

1> void saxpy_vec(int m, float a, float x[m], float y[m])

1> ^

1>

1>.\\PruCEAN01.cpp(9): error: base of array section must be pointer or array type

1> y[:] += a * x[:];

1> ^

1>

1>.\\PruCEAN01.cpp(9): error: base of array section must be pointer or array type

1> y[:] += a * x[:];

1> ^

1>

1>compilation aborted for .\\PruCEAN01.cpp (code 2)

1>Build log was saved at "file://C:\\Documents and Settings\\Administrador\\Mis documentos\\Visual Studio 2005\\Projects\\InfraV3ImgProcTest_I_CEAN\\PruCEAN01\\Release\\BuildLog.htm"

1>PruCEAN01 - 4 error(s), 0 warning(s)

========== Volver a generar todo: 0 correctos, 1 incorrectos, 0 omitidos ==========

====================================================================

AnexoTamanho
Download BuildLog.htm76.85 KB
2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Try compiling as a .c instead of a .cpp, or use /TC to compile in C mode.

Brandon Hewitt
Technical Consulting Engineer

For 1:1 technical support: http://premier.intel.com

Software Product Support info: http://www.intel.com/software/support

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!