Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Lucius_G_
Beginner
58 Views

How can I use the print_16sc?

When I run the following example :

Example

The code example below shows how to use the “complex” function ippsThreshold_16sc_I.

 

 

IppStatus cmplx_threshold(void){
     Ipp16sc x[4] = {{2,3},{3,3}, {4,3}, {4,2}};
     /// level is near to the point {2,3} = 3.6
     /// the point {2,3} is to be replaced
     /// the computed coordinates are {2.2188,3.3282}
     /// the point used is {3,4};
     /// notice that it is the point with the phase,
     /// nearest to the source
     IppStatus st = ippsThreshold_16sc_I(x, 4, 4, ippCmpLess);
     printf_16sc("complex threshold result =", x, 4, st);
     return st; 
}

it always say:  error C3861: “printf_16sc”

the header : ipp.h and ipps.h   do not contain the printf_16sc function? I use the VS2012.

Who know which header should be added into the program?

 

 

 

0 Kudos
2 Replies
Ying_H_Intel
Employee
58 Views

Hello, 

Thank for point out the issue.  It is one of  auxiliary function, the seems not available for use.  We will check it with doc team. 

you may add replace it with

printf("complex threshold result =")

for (j = 0; j < n; j++)

printf("(%d,%d)   ", (x+j)->real, (x+j)->imag);

printf( " %d : %s\n", st, ippGetStatusString( st ));

Best Regards,

Ying 

Ying_H_Intel
Employee
58 Views

Hello, 

Thank for point out the issue.  It is one of  auxiliary function, the seems not available for use directly, 

you may add replace it with

printf("complex threshold result =")

for (j = 0; j < n; j++)

printf("(%d,%d)   ", (x+j)->real, (x+j)->imag);

printf( " %d : %s\n", st, ippGetStatusString( st ));

or Copy the definition from  IPP documentation (as below) to your code. 

Developer Reference for Intel® Integrated Performance Primitives 2017 Update 1  =>  Volume 1: Signal Processing => Code Examples

Best Regards,

Ying 

Code Examples

The document contains a number of code examples that use the Intel IPP functions. These examples show both some particular features of the primitives and how the primitives can be called. Many of these code examples output result data together with the status code and associated messages in case of an error or a warning condition.

To keep the example code simpler, special definitions of print statements are used that get output strings look exactly the way it is needed for better representation of results of different format, as well as print status codes and messages.

The code definitions given below make it possible to build the examples contained in the document by straightforward copying and pasting the example code fragments.

#define genPRINT(TYPE,FMT) \
void printf_##TYPE(const char* msg, Ipp##TYPE* buf, int len, IppStatus st ) { \
   int n; \
   if( st > ippStsNoErr ) \
      printf( "\n-- warning %d, %s", st, ippGetStatusString( st )); \
   else if( st < ippStsNoErr ) \
      printf( "\n-- error %d, %s", st, ippGetStatusString( st )); \
   printf("\n %s \n", msg ); \
   for( n=0; n<len; ++n ) printf( FMT, buf ); \
   printf("\n" ); \
}
genPRINT( 64f, " %f" )
genPRINT( 32f, " %f" )
genPRINT( 32u, " %u" )
genPRINT( 16s, " %d" )
genPRINT( 8u, " %u" )

#define genPRINTcplx(TYPE,FMT) \
void printf_##TYPE(const char* msg, Ipp##TYPE* buf, int len, IppStatus st ) { \
   int n; \
   if( st > ippStsNoErr ) \
      printf( "\n-- warning %d, %s", st, ippGetStatusString( st )); \
   else if( st < ippStsNoErr ) \
      printf( "\n-- error %d, %s", st, ippGetStatusString( st )); \
   printf(" %s ", msg ); \
   for( n=0; n<len; ++n ) printf( FMT, buf.re, buf.im ); \
   printf("\n" ); \
}
genPRINTcplx( 64fc, " {%f,%f}" )
genPRINTcplx( 32fc, " {%f,%f}" )
genPRINTcplx( 16sc, " {%d,%d}" )

#define genPRINT_2D(TYPE,FMT) \
void printf_##TYPE##_2D(const char* msg, Ipp##TYPE* buf, IppiSize roi, int step, IppStatus st ) { \
   int i, j; \
   if ( st > ippStsNoErr ) { \
      printf( "\n-- warning %d, %s", st, ippGetStatusString( st )); \
   } else if ( st < ippStsNoErr ) { \
      printf( "\n-- error %d, %s", st, ippGetStatusString( st )); \
   } \
   printf("\n %s \n", msg ); \
   for ( i=0; i<roi.height; i++ ) { \
      for ( j=0; j<roi.width; j++ ) { \
         printf( FMT, ((Ipp##TYPE*)(((Ipp8u*)buf) + i*step)) ); \
      } \
      printf("\n"); \
   } \
   printf("\n" ); \
}
genPRINT_2D( 8u, " %u" )
genPRINT_2D( 32f, " %.1f" )
Reply