С/С++ Portal | Программирование
Присоединяйтесь к нашему каналу и погрузитесь в мир для C/C++-разработчика Сотрудничество, реклама: @devmangx Работаем с @Spiral_Yuri РКН: https://clck.ru/3Foc4d
Show more📈 Analytical overview of Telegram channel С/С++ Portal | Программирование
Channel С/С++ Portal | Программирование (@cpportal) in the Russian language segment is an active participant. Currently, the community unites 14 822 subscribers, ranking 8 405 in the Technologies & Applications category and 43 843 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 14 822 subscribers.
According to the latest data from 15 September, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -138 over the last 30 days and by -10 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 14.16%. Within the first 24 hours after publication, content typically collects 7.89% reactions from the total number of subscribers.
- Post reach: On average, each post receives 2 099 views. Within the first day, a publication typically gains 1 170 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 28.
- Thematic interests: Content is focused on key topics such as linux, ядро, c++, процессор, указатель.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“Присоединяйтесь к нашему каналу и погрузитесь в мир для C/C++-разработчика
Сотрудничество, реклама: @devmangx
Работаем с @Spiral_Yuri
РКН: https://clck.ru/3Foc4d”
Thanks to the high frequency of updates (latest data received on 16 September, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
18 сентября — приходи на онлайн-трансляцию, где мы расскажем подробнее о практических курсах и ответим на все вопросы. После вебинара пройдет обзорная лекция про системное программирование и роль языка С. Регистрация — здесь.
std::expected сигнатура функции может описывать и результат резервирования, и ожидаемые варианты ошибок. Это делает API проще в использовании.
👉 @Cpportal.cu с CUDA-ядром
* связать всё через pybind11
Допустим, вы написали своё ядро сложения:
#include <torch/extension.h>
__global__ void add_kernel(
const float* a,
const float* b,
float* out,
int n) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx < n)
out[idx] = a[idx] + b[idx];
}
Теперь его нужно запускать так:
void add_cuda(torch::Tensor a,
torch::Tensor b,
torch::Tensor out) {
int n = a.numel();
int threads = 256;
int blocks = (n + threads - 1) / threads;
add_kernel<<<blocks, threads>>>(
a.data_ptr<float>(),
b.data_ptr<float>(),
out.data_ptr<float>(),
n);
}
Затем экспортируем функцию через pybind11:
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("add_cuda", &add_cuda);
}
После этого собираем расширение:
from torch.utils.cpp_extension import load
ext = load(
name="my_extension",
sources=[
"my_extension.cpp",
"my_kernel.cu"
]
)
Теперь его можно использовать прямо из PyTorch:
out = torch.empty_like(a)
ext.add_cuda(a, b, out)
Подробнее это разобрано в руководстве PyTorch.
👉 @CpportalFILE* избавляет от необходимости вручную закрывать файл как при обычном выходе из функции, так и при возникновении исключения.
Именно такие абстракции C++ мне проще всего оправдать.
А ещё лучше — использовать defer.
👉 @Cpportal{user100}:cart и {user100}:orders хешируют только байты внутри {}.
Поэтому оба ключа попадают на один и тот же узел, что позволяет выполнять операции сразу над несколькими ключами в кластерном режиме.
👉 @CpportalEOWNERDEAD.
Теперь мьютекс принадлежит вам, и нужно разобраться, не оставил ли другой поток общие данные в состоянии незавершённого обновления.
👉 @Cpportaltype = utf8d[byte]
state = utf8d[256 + state*16 + type]
Некорректный ввод переводит автомат в состояние REJECT, а валидная последовательность возвращает его в ACCEPT.
👉 @Cpportali % n можно заменить на более дешёвое i & (n - 1).
Но пока GCC эту оптимизацию не выполняет, как, возможно, и некоторые другие оптимизации, связанные с контрактами.
Добиться нужного результата можно с помощью конструкции [[assume ...]], появившейся в C++23.
👉 @Cpportal