-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmigrate_kernels.sh
More file actions
42 lines (35 loc) · 891 Bytes
/
Copy pathmigrate_kernels.sh
File metadata and controls
42 lines (35 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# migrate_kernels.sh — Move non-canonical kernels to Old_Attempts
set -euo pipefail
KERNELS_DIR="knowledge3d/cranium/kernels"
OLD_DIR="$KERNELS_DIR/Old_Attempts"
mkdir -p "$OLD_DIR"
# Files to keep in kernels/ (canonical list)
CANONICAL=(
"codec_ops.cu"
"drawing_transform_ops.cu"
"color_convert.cu"
"filter_convolution.cu"
"gradient_rasterizer.cu"
"vectordotmap_encoder.cu"
"trm_ops.cu"
"ternary_ops.cu"
)
is_canonical() {
local fname="$1"
for canonical in "${CANONICAL[@]}"; do
if [[ "$fname" == "$canonical" ]]; then
return 0
fi
done
return 1
}
shopt -s nullglob
for f in "$KERNELS_DIR"/*.cu; do
basename="$(basename "$f")"
if ! is_canonical "$basename"; then
echo "Moving $basename to Old_Attempts/"
mv "$f" "$OLD_DIR/"
fi
done
echo "Kernel migration complete."