import '../../../../../globals.js';
// Copyright 2024, University of Colorado Boulder
/**
 * Saves a striped histogram into memory (for use in a radix sort).
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { alpenglow, DIRECT_MODULE_DEFAULTS, DirectModule, MAIN_RADIX_HISTOGRAM_DEFAULTS, mainRadixHistogramWGSL } from '../../../imports.js';
import { combineOptions } from '../../../../../phet-core/js/optionize.js';
export const MAIN_RADIX_HISTOGRAM_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_RADIX_HISTOGRAM_DEFAULTS
};
// inputSize: number
export default class MainRadixHistogramModule extends DirectModule {
    constructor(providedOptions) {
        const options = combineOptions({
            main: mainRadixHistogramWGSL(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('MainRadixHistogramModule', MainRadixHistogramModule);
//# sourceMappingURL=MainRadixHistogramModule.js.map