     }
 
     /// Cached (compiled and loaded) modules
-    fileprivate var modules: [ModuleCacheKey : (Module, Function)] = Dictionary(minimumCapacity: 32)
+    fileprivate var modules: [ModuleCacheKey : (Module, Function)] = Dictionary(minimumCapacity: 128)
 
     /// Initialize an instance on device
     ///

    ///   - functor: 1-place functor for element transformation
    ///   - forType: type of each element
    /// - Returns: kernel function
    func kernel<T: KernelDataProtocol>(
            _ source: BinaryOperationKernelSource, operation: BinaryOperation, forType: T.Type) -> Function {
        /// Get cached function
        let key = ModuleCacheKey(type: T.kernelDataType, source: source.rawValue, operation: operation)
        if let (_, function) = modules[key] {

        self.device = device
    }

    /// Common compile options
    private lazy var commonCompileOptions: [CompileOption] = [
        .computeCapability(self.device.computeCapability),
        .useFastMath,
        .disableWarnings,
    ]

    /// Get a compiled functorial kernel, a.k.a. kernel with a transformation functor
    /// such as `log` and `tanh`.
    /// - Note: This supports only floating point types, because unary math functions
    /// such as `sin` and `cos` are available only for floating point.
    ///
    /// - Parameters:
    ///   - source: kernel source to be compiled (if not cached) and loaded
    ///   - functor: 1-place functor for element transformation
    ///   - forType: type of each element
    /// - Returns: kernel function
    func kernel<T: KernelDataProtocol & FloatingPoint>(_ source: FunctorialKernelSource,
                                                       transformation: UnaryOperation,
                                                       forType: T.Type) -> Function {
        /// Get cached function
        let key = ModuleCacheKey(type: T.kernelDataType, source: source.rawValue, functor: transformation)
        if let (_, function) = modules[key] {
            return function
        }
        /// If not cached, compile using NVRTC
        let (module, function) = makeKernel(source, extraOptions: [
            .defineMacro("KERNEL", as: String(describing: source)),
            .defineMacro("TYPE", as: T.kernelDataType.rawValue),
            .defineMacro("FUNC", as: transformation.source(forType: T.self))
        ])
        modules[key] = (module, function)
        return function
    }

