1/* 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * All rights reserved. 4 * 5 * This source code is licensed under the BSD-style license found in the 6 * LICENSE file in the root directory of this source tree. 7 */ 8 9#version 450 core 10 11#define PRECISION ${PRECISION} 12 13layout(std430) buffer; 14 15${layout_declare_buffer(0, "w", "out_buff", DTYPE)} 16 17layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; 18 19layout(constant_id = 3) const int NITER = 1; 20 21void main() { 22 23 $for k in range(int(NREG)): 24 float reg_data${k} = float(NITER) + ${k}; 25 26 int i = 0; 27 for (; i < NITER; ++i) { 28 reg_data0 *= reg_data${int(NREG)-1}; 29 $for k in range(1, int(NREG)): 30 reg_data${k} *= reg_data${k-1}; 31 } 32 i = i >> 31; 33 34 $for k in range(int(NREG)): 35 out_buff[${k} * i] = reg_data${k}; 36} 37