Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8098327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:02:53+00:00 2026-06-05T22:02:53+00:00

I made a kernel: __kernel void square( __global uchar* input, __global uchar* output, const

  • 0

I made a kernel:

__kernel void square(                                                       
   __global uchar* input,                                             
   __global uchar* output,                                           
   const unsigned int count)                                       
{                                                                      
   int i = get_global_id(0);                                           
   if(i < count)                                                      
       output[i] = input[i] * input[i];                                
}; 

The output from my program is, input matrix and output listed. I see that all work items evaluated to val*val % 256. Why ?

Found 1 platform(s).
OutData from Write and Read:
0
[91, 2, 79, 179, 52, 205, 236, 8;
  181, 239, 26, 248, 207, 218, 45, 183;
  158, 101, 102, 18, 118, 68, 210, 139;
  198, 207, 211, 181, 162, 197, 191, 196;
  40, 7, 243, 230, 45, 6, 48, 173;
  242, 125, 175, 90, 63, 90, 22, 112;
  221, 167, 224, 113, 208, 123, 214, 35;
  229, 6, 143, 138, 98, 81, 118, 187;
  167, 140, 218, 178, 23, 43, 133, 154;
  150, 76, 101, 8, 38, 238, 84, 47]
[89, 4, 97, 41, 144, 41, 144, 64;
  249, 33, 164, 64, 97, 164, 233, 209;
  132, 217, 164, 68, 100, 16, 68, 121;
  36, 97, 233, 249, 132, 153, 129, 16;
  64, 49, 169, 164, 233, 36, 0, 233;
  196, 9, 161, 164, 129, 164, 228, 0;
  201, 241, 0, 225, 0, 25, 228, 201;
  217, 36, 225, 100, 132, 161, 100, 153;
  241, 144, 164, 196, 17, 57, 25, 164;
  228, 144, 217, 64, 164, 68, 144, 161]


OutData from Write and Read:
8913
Succed
Press any key to continue . . .
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:02:54+00:00Added an answer on June 5, 2026 at 10:02 pm

    The answer is that the operation overflows on the GPU and when using uchar type, 256 becomes 0 again and the cycle continues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made an iphone app to capture image from camera and to set that
I made a Web service in which I have a function to count some
I made changes in sched.c in Linux kernel 2.4 (homework), and now the system
I have userspace sysctl calls made to sysctl tables configured on a 2.6.24 kernel.
I'm learning how to use the kernel linked-list API from list.h . I learned
I have made two kernel modules for client and server which are transmitting the
I'm building a sample program using kernel extension on AIX 6.1. Actually, I made
I'm running Fedora 14 64 bits. I cloned the kernel source tree from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
This is a second-hand question from an OS development site, but it made me
I am maintaining a custom Linux kernel which is comprised of merged changes from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.