Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20598 Discussions

I found that the result of multiplying bit64 numbers was wrong. OpenCL1.2/OpenCL2.0 OS:Win10 Intel(R) HD Graphics 4600

jianzhong_wang
Beginner
758 Views

//The kernel of error. The result c=0x9ff7376db7ce4;  //it's error

__kernel void miniTest1(__global unsigned int * buff )

{

  const unsigned int M = 0x3FFFFFFUL, R0 = 0x3D10UL;

  unsigned int * pSrc = ( unsigned int * )buff;

 

pSrc[0] = 0x32974b6;

pSrc[1] = 0x6695f8a;

pSrc[2] = 0x3cc840c;

pSrc[3] = 0xc8998;

pSrc[4] = 0x4f06406;

pSrc[5] = 0x438d148;

pSrc[6] = 0x29e81a2;

pSrc[7] = 0x784c484;

pSrc[8] = 0x6ad6038;

pSrc[9] = 0x1383ee;

 

//

unsigned int aA[10] = { 0 };

aA[0] = pSrc[0];

aA[1] = pSrc[1];

aA[2] = pSrc[2];

aA[3] = pSrc[3];

aA[4] = pSrc[4];

aA[5] = pSrc[5];

aA[6] = pSrc[6];

aA[7] = pSrc[7];

aA[8] = pSrc[8];

aA[9] = pSrc[9];

 

 unsigned long long d = (unsigned long long)(aA[0] * 2) * aA[9]

        + (unsigned long long)(aA[1] * 2) * aA[8]

        + (unsigned long long)(aA[2] * 2) * aA[7]

        + (unsigned long long)(aA[3] * 2) * aA[6]

        + (unsigned long long)(aA[4] * 2) * aA[5];

 

  d >>= 26;

  d += (unsigned long long)(aA[1] * 2) * aA[9]

    + (unsigned long long)(aA[2] * 2) * aA[8]

    + (unsigned long long)(aA[3] * 2) * aA[7]

    + (unsigned long long)(aA[4] * 2) * aA[6]

    + (unsigned long long)aA[5] * aA[5];

 

  unsigned long long u0 = d & M;

unsigned long long c1 = u0 * R0;

  unsigned long long c = (unsigned long long)aA[0] * (unsigned long long)aA[0] + c1;

 

unsigned int iCLow = (unsigned int)c;

unsigned int iCHig = (unsigned int)(c >> 32);

printf( "c=0x%x%x;\r\n" , iCHig , iCLow );

}

 

///============================

//The kernel of ok. The result c=0x9ff9976db7ce4;  //it's ok

__kernel void miniTest2(__global unsigned int * buff )

{

  const unsigned int M = 0x3FFFFFFUL, R0 = 0x3D10UL;

  unsigned int * pSrc = ( unsigned int * )buff;

unsigned int aA[10] = { 0 };

aA[0] = pSrc[0];

aA[1] = pSrc[1];

aA[2] = pSrc[2];

aA[3] = pSrc[3];

aA[4] = pSrc[4];

aA[5] = pSrc[5];

aA[6] = pSrc[6];

aA[7] = pSrc[7];

aA[8] = pSrc[8];

aA[9] = pSrc[9];

 

aA[0] = 0x32974b6;

aA[1] = 0x6695f8a;

aA[2] = 0x3cc840c;

aA[3] = 0xc8998;

aA[4] = 0x4f06406;

aA[5] = 0x438d148;

aA[6] = 0x29e81a2;

aA[7] = 0x784c484;

aA[8] = 0x6ad6038;

aA[9] = 0x1383ee;

 

  unsigned long long d = (unsigned long long)(aA[0] * 2) * aA[9]

        + (unsigned long long)(aA[1] * 2) * aA[8]

        + (unsigned long long)(aA[2] * 2) * aA[7]

        + (unsigned long long)(aA[3] * 2) * aA[6]

        + (unsigned long long)(aA[4] * 2) * aA[5];

 

  d >>= 26;

  d += (unsigned long long)(aA[1] * 2) * aA[9]

    + (unsigned long long)(aA[2] * 2) * aA[8]

    + (unsigned long long)(aA[3] * 2) * aA[7]

    + (unsigned long long)(aA[4] * 2) * aA[6]

    + (unsigned long long)aA[5] * aA[5];

 

  unsigned long long u0 = d & M;

unsigned long long c1 = u0 * R0;

  unsigned long long c = (unsigned long long)aA[0] * (unsigned long long)aA[0] + c1;

 

unsigned int iCLow = (unsigned int)c;

unsigned int iCHig = (unsigned int)(c >> 32);

printf( "c=0x%x%x;\r\n" , iCHig , iCLow );

}

 

 

0 Kudos
1 Solution
Wanner_G_Intel
Moderator
528 Views

Hello jianzhong wang,

 

Thank you for your response.

 

Based on the information provided, miniTest.rar, this issue is most likely related to the development of an application. On these forums, we may not be able to continue assisting you since you are developing software.

 

For these types of issues, our recommendation is that you can contact the Intel® Developer Zone, register, and submit your question. 

 

Regards,

 

Wanner G.

Intel Customer Support Technician

A Contingent Worker at Intel

View solution in original post

0 Kudos
8 Replies
jianzhong_wang
Beginner
528 Views

It's a bug?

0 Kudos
Wanner_G_Intel
Moderator
528 Views

Hello jwang173,

 

Thank you for posting on this Intel Community.

 

To better assist you, we would like to have the following information:

 

1. Are you developing an application?

2. Is this problem about OpenCL1.2/OpenCL2.0?

3. Does this occur on a specific hardware/system model?

4. Are the results posted log files?

 

Wanner G.

Intel Customer Support Technician

A Contingent Worker at Intel

0 Kudos
jianzhong_wang
Beginner
528 Views
  1. Yes.
  2. Yes.
  3. I have only Intel(R) HD Graphics 4600.
  4. Sorry. I have not the log file.
0 Kudos
Wanner_G_Intel
Moderator
528 Views

Hello jwang173,

 

If experiencing issues while developing software, we would like to recommend the Intel® Developer Zone, where you can find additional documentation and tools address these types of issues. You may need to register in order to submit your questions.

 

Intel® Developer Zone contact

Intel® Developer Zone forum

 

Now, we can try to assist you on this forum, but we would like to have the following information:

 

1. The name of the application you are working on. If you can provide us with a link/demo, it will be helpful.

2. Steps to reproduce the behavior/error you are experiencing. Here you can also provide us with a YouTube* link, etc.

 

Please run these reports and attach them to this thread to gather more information about your setup and system configuration:

 

Intel® System Support Utility (Intel® SSU)

 

1. Intel® SSU Download link

2. Open the application and click "Scan" to see system and device information. The Intel® SSU defaults to the "Summary View" on the output screen following the scan. Click the menu where it says "Summary" to change to "Detailed View".

3. To save your scan, click Next and click Save.

 

DxDiag* report

1. In the keyboard, press WinLogo key + R. 

2. Type “dxdiag” and press Enter.

3. Click on "Save All Information" and save it on your computer.

 

Wanner G.

Intel Customer Support Technician

A Contingent Worker at Intel

0 Kudos
jianzhong_wang
Beginner
528 Views

1. The name of the application you are working on. If you can provide us with a link/demo, it will be helpful. ----ok. the demo is miniTest.rar

2. Steps to reproduce the behavior/error you are experiencing. Here you can also provide us with a YouTube* link, etc. ----Yes,that's how I handled it( step by step ).

3.Intel® Developer Zone. ---ok , thks

4.the information by SSU. ----ok, the file pc.txt

0 Kudos
jianzhong_wang
Beginner
528 Views
posted a file.
0 Kudos
Wanner_G_Intel
Moderator
529 Views

Hello jianzhong wang,

 

Thank you for your response.

 

Based on the information provided, miniTest.rar, this issue is most likely related to the development of an application. On these forums, we may not be able to continue assisting you since you are developing software.

 

For these types of issues, our recommendation is that you can contact the Intel® Developer Zone, register, and submit your question. 

 

Regards,

 

Wanner G.

Intel Customer Support Technician

A Contingent Worker at Intel

0 Kudos
jianzhong_wang
Beginner
528 Views

ok,tks

0 Kudos
Reply