Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Dennis_C_
Beginner
112 Views

Howto initialize IppiMomentState_64f without deprecated functions

Good morning everybody,

we wonder here how to use the ippMoment functions in IPP 7.1

The following code sample gives us compiler warnings about deprecated code.Where is the mistake?

Many thanks for your help!

best regards,

Dennis

---- sample code ---

[cpp]

#include <ippi.h>
#include <iostream>
using namespace std;

int main( int /*argc*/, char* /*argv*/[] )
{
  IppiMomentState_64f*  ctxFloat=0;

  // Allocate memory for IppiMomentState_64f
  // ippiMomentInitAlloc_64f declared deprecated in
  // http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/ipp_manual/IPPI/ippi_ch11/fu...
  //
  // how to allocate memory in the right way?
  ippiMomentInitAlloc_64f(&ctxFloat, ippAlgHintNone);

  // do some operations with not depreacted ippiMoments64f ... functions
  // ippiMoments64f_16u_C1R (..., ctxFloat)
  // ippiGetNormalizedCentralMoment_64f(ctxFloat, ...)


  // see another example:
  // http://software.intel.com/sites/products/documentation/hpc/ipp/ippi/ippi_ch11/functn_GetHuMoments.ht...


  // free memory
  // ippiMomentFree_64f called deprecated in
  // http://software.intel.com/sites/products/documentation/doclib/ipp_sa/71/ipp_manual/IPPI/ippi_ch11/fu...
  //
  // how to free memory in the right way?
  ippiMomentFree_64f(ctxFloat);
  ctxFloat = 0;
  return 0;
}

[/cpp]

--- compiler output

[bash]

g++ -m32 -Wall -Wextra  -ggdb3 -MD -O0 -fstrict-aliasing  -I/opt/intel/composer_xe_2013.3.163/ipp/include  -c test_ipp.cpp -o test_ipp.o
test_ipp.cpp: In function 'int main(int, char**)':
test_ipp.cpp:14:3: warning: 'IppStatus ippiMomentInitAlloc_64f(IppiMomentState_64f**, IppHintAlgorithm)' is deprecated (declared at /opt/intel/composer_xe_2013.3.163/ipp/include/ippi.h:7583) [-Wdeprecated-declarations]
test_ipp.cpp:14:52: warning: 'IppStatus ippiMomentInitAlloc_64f(IppiMomentState_64f**, IppHintAlgorithm)' is deprecated (declared at /opt/intel/composer_xe_2013.3.163/ipp/include/ippi.h:7583) [-Wdeprecated-declarations]
test_ipp.cpp:30:3: warning: 'IppStatus ippiMomentFree_64f(IppiMomentState_64f*)' is deprecated (declared at /opt/intel/composer_xe_2013.3.163/ipp/include/ippi.h:7603) [-Wdeprecated-declarations]
test_ipp.cpp:30:30: warning: 'IppStatus ippiMomentFree_64f(IppiMomentState_64f*)' is deprecated (declared at /opt/intel/composer_xe_2013.3.163/ipp/include/ippi.h:7603) [-Wdeprecated-declarations]
g++ -m32 -Wall -Wextra  -ggdb3 -MD -O0 -fstrict-aliasing  -I/opt/intel/composer_xe_2013.3.163/ipp/include   test_ipp.o -L/opt/intel/composer_xe_2013.3.163/ipp/lib/ia32 -lippac_l -lippdc_l -lippcc_l -lippcv_l -lippj_l -lippdi_l -lippch_l -lippm_l -lippr_l -lippsc_l -lippvm_l -lippvc_l -lippi_l -lipps_l -lippcore_l -o test_ipp
[/bash]

0 Kudos
3 Replies
Igor_A_Intel
Employee
112 Views

Hi Dennis,

ippiMomentGetBufSize and ippiMomentInit pair will be introduced instead of InitAlloc/Free in one of the nearest IPP releases.

regards, Igor

SergeyKostrov
Valued Contributor II
112 Views

Igor already explained that two different functions need to be used in all futures releases of IPP library. >>...The following code sample gives us compiler warnings about deprecated code.Where is the mistake? These are warnings and there is nothing wrong with your test case. Intel IPP team simply informs that some changes will be done in the future. If you think another functions marked as deprecated are very useful and shouldn't be deleted than leave a feedback at: http://software.intel.com/sites/products/ipp-deprecated-features-feedback. Thanks.
Dennis_C_
Beginner
112 Views

Hi Igor, hi Sergey

Just to get it right: We have to live with the warnings until the replacement fuctions are introduced in future. Not nice in our opinion but we'll get a way around it. Perhaps a hint in your docu would help other users.

Many thanks for you information,

Dennis

Reply