homer512 icon

CUDA producer-consumer pipe

homer512 | PRO | 08/21/24 03:06:53 PM UTC | 0 ⭐ | 11443 👁️ | Never ⏰ | []
C++ |

1.62 KB

|

Source Code

|

0 👍

/

0 👎

__device__ float produce(int iteration, unsigned idx);
 
__device__ void consume(int iteration, unsigned idx, float value);
 
__global__ void kernel(int iterations)
{
    /*
     * Tuning parameters: Number of samples to buffer
     * and number of producer vs. consumer threads
     */
    constexpr unsigned bufsize = 128;
    const unsigned producer_count = 32;
    const unsigned consumer_count = blockDim.x - producer_count;
    /*
     * Simple double-buffer setup to make a producer-consumer pipeline
     */
    __shared__ float buf[2][bufsize];
    const bool is_producer = threadIdx.x < producer_count;
    /*
     * Fill first buffer. This can use all threads
     */
    for(unsigned i = threadIdx.x; i < bufsize; i += blockDim.x)
        buf[0][i] = produce(0, i);
    for(int i = 1; i < iterations; ++i) {
        __syncthreads();
        int cur_buf = i & 1;
        int last_buf = (i - 1) & 1;
        if(is_producer) {
            // fill next buffer
            for(unsigned j = threadIdx.x; j < bufsize; j += producer_count)
                buf[cur_buf][j] = produce(i, j);
        }
        else {
            const unsigned consumer_idx = threadIdx.x - producer_count;
            // consume last buffer
            for(unsigned j = consumer_idx; j < bufsize; j += consumer_count)
                consume(i - 1, j, buf[last_buf][j]);
        }
    }
    __syncthreads();
    /*
     * Consume last buffer. Can use all threads
     */
    int last_buf = (iterations - 1) & 1;
    for(unsigned i = threadIdx.x; i < bufsize; i += blockDim.x)
        consume(iterations - 1, i, buf[last_buf][i]);
}

Comments

  • Borfidorn icon
    03/29/26 09:44:33 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).