import { Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography, } from '@mui/material' import type { MatmulMethod } from '../methods/types' export interface CellResult { gflops: number ms: number sample: number } export type CellState = CellResult | 'pending' | 'unavailable' | 'error' | undefined export interface ResultsTableProps { methods: MatmulMethod[] sizes: number[] cell(methodId: string, n: number): CellState } function CellContent({ state }: { state: CellState }) { if (state === undefined) return if (state === 'pending') return if (state === 'unavailable') return n/a if (state === 'error') return error return ( <>
{state.gflops.toFixed(2)} GFLOP/s
{state.ms.toFixed(1)} ms ) } export function ResultsTable({ methods, sizes, cell }: ResultsTableProps) { return ( n {methods.map((m) => ( {m.label} {m.precision} ))} {sizes.map((n) => ( {n} {methods.map((m) => ( ))} ))}
) }