import '../../../../../globals.js';
// Copyright 2023-2024, University of Colorado Boulder
/**
 * A single level of standalone reduction for non-commutative types.
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { alpenglow, DIRECT_MODULE_DEFAULTS, DirectModule, MAIN_REDUCE_NON_COMMUTATIVE_DEFAULTS, mainReduceNonCommutativeWGSL } from '../../../imports.js';
import { combineOptions } from '../../../../../phet-core/js/optionize.js';
export const MAIN_REDUCE_NON_COMMUTATIVE_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_NON_COMMUTATIVE_DEFAULTS
};
// inputSize: number
export default class MainReduceNonCommutativeModule extends DirectModule {
    constructor(providedOptions) {
        const options = combineOptions({
            main: mainReduceNonCommutativeWGSL(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('MainReduceNonCommutativeModule', MainReduceNonCommutativeModule);
//# sourceMappingURL=MainReduceNonCommutativeModule.js.map