You are a CUDA optimization expert tasked with optimizing the Dice Loss operator for deep learning inference acceleration. 

## Current Architecture
python
import torch
import torch.nn as nn

class Model(nn.Module):
“”"
Simple model that performs Dice Loss calculation for medical image segmentation.
“”"
def init(self):
super(Model, self).init()

def forward(self, pred: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
    """
    Applies Dice Loss to prediction and target tensors.

    Args:
        pred (torch.Tensor): Prediction tensor of shape (batch_size, channels, height, width)
        target (torch.Tensor): Target tensor of same shape as pred with values 0/1

    Returns:
        torch.Tensor: Dice Loss scalar value
    """
    # Flatten tensors
    pred_flat = pred.view(-1)
    target_flat = target.view(-1)
    
    # Calculate intersection and sums
    intersection = (pred_flat * target_flat).sum()
    pred_sum = pred_flat.sum()
    target_sum = target_flat.sum()
    
    # Calculate Dice coefficient and loss
    epsilon = 1e-6
    dice_score = (2.0 * intersection) / (pred_sum + target_sum + epsilon)
    dice_loss = 1.0 - dice_score
    
    return dice_loss
batch_size = 32
height, width = 256, 256
channels = 1

def get_inputs():
pred = torch.rand(batch_size, channels, height, width)
target = torch.randint(0, 2, (batch_size, channels, height, width), dtype=torch.float32)
return [pred, target]

def get_init_inputs():
return []



## Optimization Challenge
The Dice Loss calculation involves:
1. **Element-wise multiplication** for intersection calculation
2. **Summation operations** for intersection, pred_sum, and target_sum
3. **Division and subtraction** for final loss computation

## Key Optimization Opportunities
1. **Atomic Operation Bottleneck**: Avoid per-thread atomic operations
2. **Memory Access Patterns**: Optimize for coalesced memory access
3. **Vectorization**: Process multiple elements simultaneously
4. **Parallel Reduction**: Use efficient reduction strategies
5. **Shared Memory**: Leverage shared memory for intermediate results

## Success Criteria
- **Target Speedup**: 2.5-3.0x over PyTorch implementation
- **Precision**: Maintain numerical accuracy within 1e-4
- **Scalability**: Performance should scale with tensor size
- **Memory Efficiency**: Minimize memory footprint

## Technical Requirements
- Use CUDA C++ with inline compilation
- Implement multiple optimization strategies (vectorization, shared memory, warp reduction)
- Handle edge cases and boundary conditions
- Ensure numerical stability with epsilon
- Support different tensor shapes and batch sizes

## Implementation Strategy
Consider the following optimization approaches:
1. **Vectorized Processing**: Process 8-16 elements per thread
2. **Hierarchical Reduction**: Thread → Warp → Block → Grid
3. **Memory Coalescing**: Align memory access patterns
4. **Occupancy Optimization**: Balance register usage and thread count
5. **Algorithmic Improvements**: Reduce computational complexity

## Expected Deliverables
- Custom CUDA kernel implementation
- Comprehensive performance benchmarking
- Precision validation against PyTorch
- Scalability analysis across different tensor sizes

Your task is to implement a high-performance Dice Loss that achieves the target speedup while