|
| 1 | +<script lang="ts"> |
| 2 | + import Icon from '@iconify/svelte'; |
| 3 | + import roundWarning from '@iconify/icons-ic/round-warning'; |
| 4 | +
|
| 5 | + import { currentMemoryRegion } from '../lib/stores'; |
| 6 | + import { AccordionGroup, AccordionItem } from '@skeletonlabs/skeleton'; |
| 7 | +</script> |
| 8 | + |
| 9 | +{#if $currentMemoryRegion.name !== undefined} |
| 10 | + <div class="variant-glass p-2 rounded-3xl text-sm mt-4"> |
| 11 | + <AccordionGroup spacing="space-y-1" collapse={false}> |
| 12 | + <AccordionItem> |
| 13 | + <svelte:fragment slot="summary" |
| 14 | + ><div class="text-center font-bold">Active Kernel Information</div></svelte:fragment |
| 15 | + > |
| 16 | + <svelte:fragment slot="content"> |
| 17 | + <div class="text-center font-mono">Grid Sizing</div> |
| 18 | + <div class="flex flex-row justify-around"> |
| 19 | + <div class="flex flex-col justify-center"> |
| 20 | + <div class="text-center text-xs font-mono opacity-60">X</div> |
| 21 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 22 | + {$currentMemoryRegion.kernelSettings.GridDimensions.x} |
| 23 | + </div> |
| 24 | + </div> |
| 25 | + <div class="flex flex-col justify-center"> |
| 26 | + <div class="text-center text-xs font-mono opacity-60">Y</div> |
| 27 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 28 | + {$currentMemoryRegion.kernelSettings.GridDimensions.y} |
| 29 | + </div> |
| 30 | + </div> |
| 31 | + <div class="flex flex-col justify-center"> |
| 32 | + <div class="text-center text-xs font-mono opacity-60">Z</div> |
| 33 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 34 | + {$currentMemoryRegion.kernelSettings.GridDimensions.z} |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + |
| 39 | + <div class="text-center font-mono mt-3">Block Sizing</div> |
| 40 | + <div class="flex flex-row justify-around"> |
| 41 | + <div class="flex flex-col justify-center"> |
| 42 | + <div class="text-center text-xs font-mono opacity-60">X</div> |
| 43 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 44 | + {$currentMemoryRegion.kernelSettings.BlockDimensions.x} |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + <div class="flex flex-col justify-center"> |
| 48 | + <div class="text-center text-xs font-mono opacity-60">Y</div> |
| 49 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 50 | + {$currentMemoryRegion.kernelSettings.BlockDimensions.y} |
| 51 | + </div> |
| 52 | + </div> |
| 53 | + <div class="flex flex-col justify-center"> |
| 54 | + <div class="text-center text-xs font-mono opacity-60">Z</div> |
| 55 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 56 | + {$currentMemoryRegion.kernelSettings.BlockDimensions.z} |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + |
| 61 | + <div class="text-center font-mono mt-3 mb-2">Warp Size</div> |
| 62 | + <div class="flex flex-row justify-around"> |
| 63 | + <div class="flex flex-col justify-center"> |
| 64 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 65 | + {$currentMemoryRegion.kernelSettings.WarpSize} |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + </svelte:fragment> |
| 70 | + </AccordionItem> |
| 71 | + <AccordionItem> |
| 72 | + <svelte:fragment slot="summary" |
| 73 | + ><div class="text-center font-bold">Active Memory Information</div></svelte:fragment |
| 74 | + > |
| 75 | + <svelte:fragment slot="content"> |
| 76 | + <div class="text-center font-mono mb-2">Name</div> |
| 77 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-100"> |
| 78 | + {$currentMemoryRegion.name} |
| 79 | + </div> |
| 80 | + |
| 81 | + <div class="text-center font-mono mt-3 mb-2">Address Range</div> |
| 82 | + <div |
| 83 | + class="flex flex-row justify-around cursor-help" |
| 84 | + title="The memory region contains a total of {$currentMemoryRegion.numberOfElements} elements at a size of {$currentMemoryRegion.sizeOfSingleElement} bytes per element." |
| 85 | + > |
| 86 | + <div class="flex flex-row justify-center"> |
| 87 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 88 | + {$currentMemoryRegion.startAddress} |
| 89 | + </div> |
| 90 | + <div class="text-center py-1 px-3 min-w-[16px]">-</div> |
| 91 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[64px]"> |
| 92 | + {$currentMemoryRegion.endAddress} |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + |
| 97 | + <div class="text-center font-mono mt-3 mb-2">Logged Accesses</div> |
| 98 | + <div class="flex flex-row justify-around"> |
| 99 | + <div class="flex flex-col justify-center"> |
| 100 | + <div class="text-center text-xs font-mono opacity-60">Reading</div> |
| 101 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[92px]"> |
| 102 | + {$currentMemoryRegion.totalReads} |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + <div class="flex flex-col justify-center"> |
| 106 | + <div class="text-center text-xs font-mono opacity-60">Writing</div> |
| 107 | + <div class="text-center py-1 px-3 variant-glass rounded-xl min-w-[92px]"> |
| 108 | + {$currentMemoryRegion.totalWrites} |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + </div> |
| 112 | + </svelte:fragment> |
| 113 | + </AccordionItem> |
| 114 | + </AccordionGroup> |
| 115 | + |
| 116 | + {#if $currentMemoryRegion.kernelSettings.CurrentSize > $currentMemoryRegion.kernelSettings.OriginalSize} |
| 117 | + <aside |
| 118 | + class="alert variant-filled-error mt-4 cursor-help" |
| 119 | + title="{$currentMemoryRegion.kernelSettings.OriginalSize} elements were allocated, {$currentMemoryRegion |
| 120 | + .kernelSettings.CurrentSize} elements were accessed" |
| 121 | + > |
| 122 | + <!-- Message --> |
| 123 | + <div class="alert-message"> |
| 124 | + <div class=" text-sm flex "> |
| 125 | + <div class="local-icon-style"><Icon icon={roundWarning} width="32" height="32" /></div> |
| 126 | + The memory storage which was used to store the data was too small to fit all accesses. ({$currentMemoryRegion |
| 127 | + .kernelSettings.CurrentSize - $currentMemoryRegion.kernelSettings.OriginalSize} more elements needed to be |
| 128 | + allocated when initializing) |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + </aside> |
| 132 | + {/if} |
| 133 | + </div> |
| 134 | +{/if} |
| 135 | + |
| 136 | +<style> |
| 137 | + .local-icon-style { |
| 138 | + min-width: 24px; |
| 139 | + transform: translateX(-12px); |
| 140 | + } |
| 141 | +</style> |
0 commit comments