UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor mouhamedmbr
Visitor
1,875 Views
Registered: ‎10-27-2017

error: expected ',' or '...' before 'predict_label1'

hello ,i 'm trying to compile my c code .i use the exemple of multiplication ,

in the exemple of multiplication we have 2 input an a output 

void matrix_multiply_ref(T a[DIM][DIM], T b[DIM][DIM], T out[DIM][DIM])

in my code i have 1 input and 3 output . when i compile my code i have this error "../../../../src/main.cpp:94:44: error: expected ',' or '...' before 'predict_label1'"

this is my code :

template <typename T, int DIM>
void testtestphase_hw(T l[DIM][DIM], T out predict_label1 [DIM][DIM], T out precision1[DIM][DIM],T out prob_estimates_t1[DIM][DIM])
{
	// 
	
#pragma HLS INLINE off
#pragma HLS array_partition variable=a block factor=FACTOR dim=2
#pragma HLS array_partition variable=b block factor=FACTOR dim=1

	// matrix 
	for (int il = 0; il < DIM; ++il)
		for (int jl = 0; jl < DIM; ++jl)
		{
#pragma HLS PIPELINE II=1
			T out[ predict_label1[DIM][DIM], precision1[DIM][DIM],prob_estimates_t1[DIM][DIM]]=[ predict_label1[DIM][DIM], precision1[DIM][DIM],prob_estimates_t1[DIM][DIM]]
			
		}

		return;
Tags (1)
error.PNG
0 Kudos
4 Replies
Contributor
Contributor
1,855 Views
Registered: ‎03-13-2017

Re: error: expected ',' or '...' before 'predict_label1'

It looks like the solution is in the first error message, which explains clearly where is  the problem. There is a ' ' (blank) in between of 'out' and 'predict_label1'

T out predict_label1 [DIM][DIM],

Did you forget an underscore ?
The same applies for the following arguments.

0 Kudos
Scholar u4223374
Scholar
1,853 Views
Registered: ‎04-26-2015

Re: error: expected ',' or '...' before 'predict_label1'

The problem is evidently this line:

 

T out[ predict_label1[DIM][DIM], precision1[DIM][DIM],prob_estimates_t1[DIM][DIM]]=[ predict_label1[DIM][DIM], precision1[DIM][DIM],prob_estimates_t1[DIM][DIM]]

I don't know what you're trying to do here. It's not valid C (because C does not do "[a,b,c]" style formatting), and even if it was valid C it'd just cause a segfault (accessing elements outside the array boundaries).

0 Kudos
Visitor mouhamedmbr
Visitor
1,839 Views
Registered: ‎10-27-2017

Re: error: expected ',' or '...' before 'predict_label1'

T out[ predict_label1[DIM][DIM], precision1[DIM][DIM],prob_estimates_t1[DIM][DIM]]=[ predict_label1[DIM][DIM], precision1[DIM][DIM],prob_estimates_t1[DIM][DIM]]

i mean for exemple : T out a[DIM][DIM] =a ; 

 

 

0 Kudos
Scholar u4223374
Scholar
1,805 Views
Registered: ‎04-26-2015

Re: error: expected ',' or '...' before 'predict_label1'

I'm still not sure what you're doing with that line. Are you trying to make a new array that is an exact copy of "a"? If so, that's going to be expensive - it'll have to copy every element individually (ie N² cycles).

 

T out a[DIM][DIM] =a ; 

The problems I can see here:

 

(1) "T out a" is not valid. In C, you need "<type> <name>" (eg. "int x" or "float y"). For an array, it'll be that plus square brackets for the dimensions (eg. "int x[123]" or "float y[123][456]"). Assuming that T is a type, "T a" would be acceptable, as would "T a[DIM][DIM]" - but I have no idea what the "out" is doing in there.

 

(2) Assuming you drop the "out" and just have "T a[DIM][DIM] = a", you've just defined a new variable with the same name as an existing variable. I suspect that the compiler will actually handle this, but it's going to be very confusing.

 

(3) Changing the name to "b" (ie "T b[DIM][DIM] = a") will not do what you want (at least if my understanding of what you want is correct). C cannot initialize one array from another array (as Matlab would, for example). The only way to achieve that behaviour is to create the new array and then copy each element across (this is what Matlab does, but you don't have to tell it to do that).

 

 

0 Kudos