import '../../../../../globals.js';
// Copyright 2024, University of Colorado Boulder
/**
 * Meant for reduction on u32/i32 values (could be generalized to things that can be represented with multiple atomic
 * values, haven't run into that yet).
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { alpenglow, DIRECT_MODULE_DEFAULTS, DirectModule, MAIN_REDUCE_ATOMIC_DEFAULTS, mainReduceAtomicWGSL } from '../../../imports.js';
import { combineOptions } from '../../../../../phet-core/js/optionize.js';
export const MAIN_REDUCE_ATOMIC_MODULE_DEFAULTS = {
    // eslint-disable-next-line phet/no-object-spread-on-non-literals
    ...DIRECT_MODULE_DEFAULTS,
    // eslint-disable-next-line phet/no-object-spread-on-non-literals
    ...MAIN_REDUCE_ATOMIC_DEFAULTS
};
// inputSize: number
export default class MainReduceAtomicModule extends DirectModule {
    constructor(providedOptions) {
        const options = combineOptions({
            main: mainReduceAtomicWGSL(providedOptions),
            setDispatchSize: (dispatchSize, inputSize) => {
                dispatchSize.x = Math.ceil(inputSize / (providedOptions.workgroupSize * providedOptions.grainSize));
            }
        }, providedOptions);
        super(options);
        this.input = options.input;
        this.output = options.output;
    }
}
alpenglow.register('MainReduceAtomicModule', MainReduceAtomicModule);
//# sourceMappingURL=MainReduceAtomicModule.js.map