Skip to content

Commit 14f7663

Browse files
committed
Fixed the module8 and module9 Makefile
1 parent fde7cef commit 14f7663

File tree

2 files changed

+11
-84
lines changed

2 files changed

+11
-84
lines changed

modules/module8/examples/01_deep_learning_hip.cpp

Lines changed: 10 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,7 @@ const int WAVEFRONT_SIZE = 64;earning Inference Kernels (HIP)
1515
*
1616
* Production-quality neural network inference implementations optimized for AMD GPU architectures.
1717
* This example demonstrates deep learning kernels adapted for ROCm/HIP with wavefront-aware
18-
* optimizations and LDS utilization patterns spec HIP_CHECK(hipFree(d_data));
19-
}
20-
21-
#ifdef HAS_MIOPEN
22-
void demo_miopen_integration() {
23-
std::cout << "\n=== MIOpen Integration Demo ===\n";
24-
25-
// Initialize MIOpen handle
26-
miopenHandle_t miopen_handle;
27-
MIOPEN_CHECK(miopenCreate(&miopen_handle));
28-
29-
std::cout << "MIOpen handle created successfully\n";
30-
std::cout << "MIOpen is available for production neural network layers\n";
31-
std::cout << "Supported operations: Convolution, Pooling, Activation, BatchNorm, RNN\n";
32-
33-
// Cleanup
34-
MIOPEN_CHECK(miopenDestroy(miopen_handle));
35-
}
36-
#endif
37-
38-
int main() {fic to AMD hardware.
18+
* optimizations and LDS utilization patterns specific to AMD hardware.
3919
*
4020
* Topics Covered:
4121
* - Wavefront-optimized convolution kernels for AMD GPUs
@@ -687,29 +667,30 @@ void benchmark_activation_functions() {
687667

688668
#ifdef HAS_MIOPEN
689669
void demo_miopen_integration() {
690-
std::cout << "\n=== MIOpen Integration Demo ===\n";
670+
std::cout << "\\n=== MIOpen Integration Demo ===\\n";
691671

692672
// Initialize MIOpen handle
693673
miopenHandle_t miopen_handle;
694674
MIOPEN_CHECK(miopenCreate(&miopen_handle));
695675

696-
std::cout << "MIOpen handle created successfully\n";
697-
std::cout << "MIOpen is available for production neural network layers\n";
698-
std::cout << "Supported operations: Convolution, Pooling, Activation, BatchNorm, RNN\n";
676+
std::cout << "MIOpen handle created successfully\\n";
677+
std::cout << "MIOpen is available for production neural network layers\\n";
678+
std::cout << "Supported operations: Convolution, Pooling, Activation, BatchNorm, RNN\\n";
699679

700680
// Cleanup
701681
MIOPEN_CHECK(miopenDestroy(miopen_handle));
702682
}
703-
#endif\n\nint main() {
704-
#ifdef HAS_ROC_LIBRARIES
683+
#endif
684+
685+
int main() {
705686
std::cout << "HIP Deep Learning Inference Kernels - AMD GPU Optimized Implementation\n";
706687
std::cout << "======================================================================\n";
707688

708689
// Check HIP device properties
709690
int device;
710-
hipGetDevice(&device);
691+
HIP_CHECK(hipGetDevice(&device));
711692
hipDeviceProp_t props;
712-
hipGetDeviceProperties(&props, device);
693+
HIP_CHECK(hipGetDeviceProperties(&props, device));
713694

714695
std::cout << "GPU: " << props.name << "\n";
715696
std::cout << "Compute Capability: " << props.major << "." << props.minor << "\n";
@@ -755,58 +736,4 @@ void demo_miopen_integration() {
755736
}
756737

757738
return 0;
758-
#else
759-
// Note: Individual ROCm libraries are detected automatically by the Makefile
760-
// The main functionality will run with whatever libraries are available
761-
762-
// Check HIP device properties
763-
int device;
764-
hipGetDevice(&device);
765-
hipDeviceProp_t props;
766-
hipGetDeviceProperties(&props, device);
767-
768-
std::cout << "GPU: " << props.name << "\n";
769-
std::cout << "Compute Capability: " << props.major << "." << props.minor << "\n";
770-
std::cout << "Memory: " << props.totalGlobalMem / (1024*1024) << " MB\n";
771-
std::cout << "Wavefront Size: " << WAVEFRONT_SIZE << "\n";
772-
std::cout << "LDS Size per Workgroup: " << props.sharedMemPerBlock << " bytes\n";
773-
std::cout << "Max Threads per Block: " << props.maxThreadsPerBlock << "\n\n";
774-
775-
// Print available ROCm libraries
776-
std::cout << "Available ROCm Libraries:\n";
777-
#ifdef HAS_ROCBLAS
778-
std::cout << " ✓ rocBLAS\n";
779-
#else
780-
std::cout << " ✗ rocBLAS (install rocblas-dev)\n";
781-
#endif
782-
#ifdef HAS_ROCRAND
783-
std::cout << " ✓ rocRAND\n";
784-
#else
785-
std::cout << " ✗ rocRAND (install rocrand-dev)\n";
786-
#endif
787-
#ifdef HAS_ROCFFT
788-
std::cout << " ✓ rocFFT\n";
789-
#else
790-
std::cout << " ✗ rocFFT (install rocfft-dev)\n";
791-
#endif
792-
#ifdef HAS_MIOPEN
793-
std::cout << " ✓ MIOpen\n";
794-
#else
795-
std::cout << " ✗ MIOpen (install miopen-hip-dev)\n";
796-
#endif
797-
std::cout << "\n";
798-
799-
try {
800-
benchmark_convolution_kernels();
801-
802-
std::cout << "\n=== Note: Install ROCm libraries for full functionality ===\n";
803-
std::cout << " sudo apt install rocblas-dev rocrand-dev rocfft-dev miopen-hip-dev\n";
804-
805-
} catch (const std::exception& e) {
806-
std::cerr << "Error: " << e.what() << std::endl;
807-
return -1;
808-
}
809-
810-
return 0;
811-
#endif
812739
}

modules/module9/examples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endif
2828
# Compiler flags for production-ready applications
2929
CUDA_FLAGS = -std=c++17 -O3 -arch=sm_70 -lineinfo --use_fast_math -DPRODUCTION_BUILD
3030
CUDA_DEBUG_FLAGS = -std=c++17 -g -G -arch=sm_70 -DDEBUG_BUILD
31-
HIP_FLAGS = -std=c++17 -O3 --fast-math -DPRODUCTION_BUILD
31+
HIP_FLAGS = -std=c++17 -O3 -ffast-math -DPRODUCTION_BUILD
3232
HIP_DEBUG_FLAGS = -std=c++17 -g -DDEBUG_BUILD
3333
CXX_FLAGS = -std=c++17 -O3 -DPRODUCTION_BUILD
3434

0 commit comments

Comments
 (0)