soft5

New bug found in AMD CPU Athlon 64 X2 5400+

Discussion created by soft5 on Dec 7, 2009
Latest reply on Dec 17, 2009 by wilsncharle

I write an image rotation function, on AMD Athlon 64 X2 5400+(HP CQ3009cx desktop PC), when image height is 1536, the performance of AMD cpu suddenly reduce 70%, that is terrible. My OS is windows XP sp3, compiler is visual studio 2005, and the code is normally for Intel CPU. the following is some output result for Athlon X2 5400+, and the problem existed on Athlon X2 QL-66, may be on other AMD processor.

 

Height = 1535. time: 312 ms.

Height = 1536. time: 2219ms.

Height = 1537. time: 297ms.

I contact to AMD support and HP support, they both can not help me to confirm this problem, so I post this message here, can any AMD engineers confirm this problem for me?

 

 

// TestRotation.cpp : Defines the entry point for the console application. // #include <stdio.h> #include <windows.h> #define WIDTH 2144 #define HEIGHT 1536 // 1536, bad #define LOOP_COUNT 16 // we count from (1536 - 8) to (1536 + 8) #define BEGIN_LOG_TIME() \ DWORD dwTickStart_, dwTickEnd_; \ dwTickStart_ = GetTickCount(); #define END_LOG_TIME_TRACE() \ dwTickEnd_ = GetTickCount(); \ printf("time: %d ms.\n", dwTickEnd_ - dwTickStart_); int CC_Rotation(BYTE *pBufIn, BYTE *pBufOut, int nHeight, int nWidth); ////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { printf("Test Rotation for AMD CPU Athlon 64 X2 (5400+ or others ... ).\n"); int nBufSize = WIDTH * (HEIGHT + LOOP_COUNT); BYTE *pIn, *pOut; pIn = new BYTE [nBufSize]; pOut= new BYTE [nBufSize]; for (int k=0; k<LOOP_COUNT; k++) { int nHeight = (HEIGHT - LOOP_COUNT/2) + k; printf("Height = %d. ", nHeight); BEGIN_LOG_TIME(); for (int i=0; i<10; i++) CC_Rotation(pIn, pOut, nHeight, WIDTH); END_LOG_TIME_TRACE(); } printf("Press return key to end !"); getchar(); delete [] pIn; delete [] pOut; return 0; } int CC_Rotation(BYTE *pBufIn, BYTE *pBufOut, int nHeight, int nWidth) { int i,j; BYTE *p = pBufIn, *q = pBufOut; BYTE *pHead = NULL; p = pBufIn; pHead = pBufOut + nHeight; q = pHead; for(i=0; i<nHeight; i++) { q = --pHead; for (j=0; j<nWidth; j++) { *q = *p++; q += nHeight; } } return 0; }

Outcomes