refactor: move legacy migration examples to docs/archive subdirectory
Legacy Content Organization: ✅ MIGRATION EXAMPLES ARCHIVED: Moved legacy migration examples to documentation archive - docs/archive/migration_examples/: Moved from root directory for better organization - Contains GPU acceleration migration examples from CUDA to abstraction layer - Educational/reference material for historical context and migration procedures ✅ LEGACY CONTENT IDENTIFIED: - GPU Acceleration Migration: From CUDA-specific to backend-agnostic abstraction layer - Migration Patterns: BEFORE/AFTER code examples showing evolution - Legacy Import Paths: high_performance_cuda_accelerator, fastapi_cuda_zk_api - Deprecated Classes: HighPerformanceCUDAZKAccelerator, ProductionCUDAZKAPI ✅ DOCUMENTATION ARCHIVE CONTENTS: - MIGRATION_CHECKLIST.md: Step-by-step migration procedures - basic_migration.py: Direct CUDA calls to abstraction layer examples - api_migration.py: FastAPI endpoint migration examples - config_migration.py: Configuration migration examples ✅ ROOT DIRECTORY CLEANUP: Removed legacy examples from production directory - migration_examples/ moved to docs/archive/migration_examples/ - Root directory now contains only active production components - Legacy migration examples preserved for historical reference DIRECTORY STRUCTURE IMPROVEMENT: 📁 docs/archive/migration_examples/: Historical migration documentation 🏗️ Root Directory: Clean production structure with only active components 📚 Documentation Archive: Legacy content properly organized for reference BENEFITS: ✅ Clean Production Directory: No legacy examples in root ✅ Historical Preservation: Migration examples preserved for reference ✅ Better Organization: Legacy content grouped in documentation archive ✅ Clear Separation: Active vs legacy content clearly distinguished RESULT: Successfully moved legacy migration examples to docs/archive/migration_examples/ subdirectory, cleaning up the root directory while preserving historical migration documentation for future reference.
This commit is contained in:
40
docs/archive/migration_examples/basic_migration.py
Executable file
40
docs/archive/migration_examples/basic_migration.py
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Basic Migration Example
|
||||
|
||||
Shows how to migrate from direct CUDA calls to the new abstraction layer.
|
||||
"""
|
||||
|
||||
# BEFORE (Direct CUDA)
|
||||
# from high_performance_cuda_accelerator import HighPerformanceCUDAZKAccelerator
|
||||
#
|
||||
# accelerator = HighPerformanceCUDAZKAccelerator()
|
||||
# if accelerator.initialized:
|
||||
# result = accelerator.field_add_cuda(a, b)
|
||||
|
||||
# AFTER (Abstraction Layer)
|
||||
import numpy as np
|
||||
from gpu_acceleration import GPUAccelerationManager, create_gpu_manager
|
||||
|
||||
# Method 1: Auto-detect backend
|
||||
gpu = create_gpu_manager()
|
||||
gpu.initialize()
|
||||
|
||||
a = np.array([1, 2, 3, 4], dtype=np.uint64)
|
||||
b = np.array([5, 6, 7, 8], dtype=np.uint64)
|
||||
|
||||
result = gpu.field_add(a, b)
|
||||
print(f"Field addition result: {result}")
|
||||
|
||||
# Method 2: Context manager (recommended)
|
||||
from gpu_acceleration import GPUAccelerationContext
|
||||
|
||||
with GPUAccelerationContext() as gpu:
|
||||
result = gpu.field_mul(a, b)
|
||||
print(f"Field multiplication result: {result}")
|
||||
|
||||
# Method 3: Quick functions
|
||||
from gpu_acceleration import quick_field_add
|
||||
|
||||
result = quick_field_add(a, b)
|
||||
print(f"Quick field addition: {result}")
|
||||
Reference in New Issue
Block a user